Automattic / Automattic/simplenote-electron
Web app: Incorrect cursor location when typing with Arabic (RTL) language
- Dominant language
- TypeScript
- Stars
- 5.3k
- Forks
- 588
- Avg merge
- 9h 45m
- Merged PRs (30d)
- 4
Description
### Expected
I would expect the cursor stays on the left most location when I'm typing with a Right-to-Left language (e.g. Arabic).
### Observed
The cursor jumps to the start of the line (right most location) when I type a whitespace after a word. The cursor moves back to the left most location until I type the next character.
### Reproduced
**Note:** The issue was replicated by pasting some Arabic text and adding a whitespace to simulate the situation.
1. Add a new note on https://app.simplenote.com
2. Paste some Arabic text to the note (e.g. ما هو لوريم ايبسوم) and type a whitespace
3. See the cursor shifts from the right-most location

Direct link to GIF: https://d.pr/i/xJsbdN/rA9hbYVpWG
### Where did you see the bug
- System Make: Apple
- System Model: iMac 27-inch
- OS: Mac OS
- OS version: Catalina 10.15.6
- Browser (if applicable): Firefox
- Browser version (if applicable): 81.0
- Simplenote app version: 1.21.1 (the same can be replicated on https://staging.simplenote.com)
Originally reported in 3304124-zen.
Contributor guide
Research direction
Start by reproducing the cursor movement in a new note on app.simplenote.com or staging.simplenote.com using the Arabic example and Firefox. Trace the web editor's handling of right-to-left text and whitespace; done means the cursor remains at the expected leftmost location after typing a space and continues behaving correctly on the next character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100