keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
398 stars 112 forks source link

bug(web): Keyboard direction does not change from LTR to RTL (Tamil to Arabic) #12377

Open dinakaranr opened 1 month ago

dinakaranr commented 1 month ago

Describe the bug

The text does not appear in the RTL direction. The keyboard switch works if refreshing the page before selecting the keyboard. 

Reproduce the bug

Steps to reproduce:

  1. Installed the "keymandeveloper-18.0.104.exe" file.
  2. Double-click on the "Keyman Developer" icon.
  3. The developer tool appeared correctly. Open the Keyman keyboard project (*.kpj) file.
  4. Open any keyman keyboard (*.kmn) file. (e.g., Tamil 99 text, gff_amheric)
  5. Navigate to the "Build" tab by clicking the *.kmn link button.
  6. Compile the changes by clicking the "Compile Keyboard".
  7. Click the "Test Keyboard on Web" button.
  8. Select the "http://localhost:8008" and click the "Open in browser" button.
  9. Navigation moved on the browser for the keyboard.
  10. Select an LTR(Tamil) keyboard by clicking the "Keyboard" button.
  11. Type a text by clicking OSK or the physical keyboard.
  12. Select another RTL(Arabic) keyboard by clicking the "Keyboard" button.
  13. Type a text by clicking OSK or the physical keyboard.

Actual Results: Here, Text does not appear in the RTL direction. It appears LTR direction if I refresh the page before selecting the keyboard.

Expected behavior

No response

Related issues

No response

Keyman apps

Keyman version

18.0.104

Operating system

Windows 10 OS

Device

No response

Target application

No response

Browser

FireFox

Keyboard name

No response

Keyboard version

No response

Language name

arabic

Additional context

No response

ermshiperete commented 1 month ago

I can't reproduce this with, neither with Keyman Developer 18.0.108 nor with KeymanWeb Sample Page.

If I don't delete all content before switching to the RTL keyboard then the text stays on the left, but that is expected. But if I delete all content and then switch to RTL the text moves to the right. Text direction in either case is RTL.

mcdurdin commented 1 month ago

There are two parts to this:

  1. the &kmw_rtl store tells KMW to set the primary text direction of the text control to RTL, so if that store is present with the value 1, then simply selecting the keyboard should change the primary text direction.
  2. If the store is not present, then the presence of RTL text at the start of the text field will set the text direction.