WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
196481
Caret shows in the wrong location in RTL text fields
https://bugs.webkit.org/show_bug.cgi?id=196481
Summary
Caret shows in the wrong location in RTL text fields
Simon Fraser (smfr)
Reported
2019-04-01 20:36:47 PDT
Created
attachment 366466
[details]
Testcase Load the attached testcase, click in the input, and type the letter 'a'. Note how the caret stays on the left side. Now type 'b' Note how the letter was input on the right side, which is not where the caret shows.
Attachments
Testcase
(217 bytes, text/html)
2019-04-01 20:36 PDT
,
Simon Fraser (smfr)
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-04-01 20:38:10 PDT
<
rdar://problem/49507145
>
Simon Fraser (smfr)
Comment 2
2019-04-01 20:38:38 PDT
Also, if you hit Command-Right arrow to move the caret to the end, and type, the text is inserted on the left side.
Ryosuke Niwa
Comment 3
2019-04-01 20:49:23 PDT
This is expected. We show the caret at where the next character whose directionality match that of the block direction.
Simon Fraser (smfr)
Comment 4
2019-04-01 20:51:54 PDT
The behavior doesn't make sense, and doesn't agree with Firefox. If I type a character, I expect it to get inserted where the caret is.
Simon Fraser (smfr)
Comment 5
2019-04-01 20:54:38 PDT
It also doesn't match native text fields in RTL.
Ryosuke Niwa
Comment 6
2019-04-01 20:55:50 PDT
(In reply to Simon Fraser (smfr) from
comment #5
)
> It also doesn't match native text fields in RTL.
Yeah, indeed. It looks like NSTextView has changed its behavior at some point in the past. Note that Firefox's behavior is irrelevant here because each browser implements its own bidi behavior in this regard, and we really want to match the platform convention.
Simon Fraser (smfr)
Comment 7
2019-04-01 20:56:39 PDT
Oh, I guess the difference is whether I'm actually entering characters in an RTL language. If I type Hebrew, it works as expected. If I type English, it does not.
Simon Fraser (smfr)
Comment 8
2019-04-01 20:59:11 PDT
Typing "1234" and moving the caret around shows that we don't match the OS.
Ryosuke Niwa
Comment 9
2019-04-01 20:59:22 PDT
(In reply to Simon Fraser (smfr) from
comment #7
)
> Oh, I guess the difference is whether I'm actually entering characters in an > RTL language. If I type Hebrew, it works as expected. If I type English, it > does not.
Yeah, it looks like NSTextView decides the caret location based on the last character being typed. Implementing the new NSTextView behavior is going to be a massive undertaking.
Ryosuke Niwa
Comment 10
2019-04-01 21:01:04 PDT
(In reply to Simon Fraser (smfr) from
comment #8
)
> Typing "1234" and moving the caret around shows that we don't match the OS.
Numbers are tricky because they're weakly LTR. Try typing numbers after Hebrew / Arabic.
Ahmad Saleem
Comment 11
2023-07-27 12:33:16 PDT
This is reproducible in WebKit ToT (
266363@main
) and Chrome Canary 117 as well. Only Firefox Nightly 117 show 'caret' properly on the right side while typing.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug