RTL content has a wrong caret position in dir=auto TEXTAREA with LTR placeholder value
Reported by
shaul.kr...@gmail.com,
Jun 25 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:44.0) Gecko/20100101 Firefox/47.0 Example URL: https://jsfiddle.net/z6mxsq1f/4/ Steps to reproduce the problem: 1. Create textarea with LTR language placeholder string, and dir="auto" attribute. 2. Try to type RTL language characters in the textarea. What is the expected behavior? The cursor should be in the end of the RTL string (left side of the string). What went wrong? The cursor is in the start of the string (right side). Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 51.0.2704.103 Channel: stable OS Version: 7 SP1 Flash Version:
,
Jun 30 2016
> 2. Try to type RTL language characters in the textarea. Could you explain more about this step? What do you mean by "try" concretely? Is the "placeholder" attribute really necessary to reproduce the issue?
,
Jun 30 2016
You don't have to type, you can see in my example, if you try to go to the end (press "end" button) of the textarea string the cursor is in the wrong place. I took some screenshots to explain it: https://imgur.com/a/oQrQZ BTW, this bug not exist the other way around. If your place holder is in RTL language and the content is LTR, the cursor is in the correct position.
,
Jul 1 2016
Thank you for providing more feedback. Adding requester "tkent@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 3 2016
Ah, I understand. A placeholder attribute value affects the caret position though the placeholder is invisible!
,
Jul 4 2016
Yes, the caret is still in LTR mode while the content is RTL, because of the LTR placeholder value.
,
Jul 13 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/55f27bb5c4f4f99a2885dc67bd6e448a464505ed commit 55f27bb5c4f4f99a2885dc67bd6e448a464505ed Author: tkent <tkent@chromium.org> Date: Wed Jul 13 07:29:15 2016 Placeholder content direction should not affect INPUT/TEXTAREA direction. Skip -webkit-input-placeholder elements when we compute direction for dir=auto in HTMLElement::directionality. - Using <bdi> for placeholders doesn't work. We want to inherit placeholder direction from the parent element. - Using unicode-bidi CSS property doesn't work. It doesn't affect dir=auto computation. BUG= 623270 , 625739 Review-Url: https://codereview.chromium.org/2145823003 Cr-Commit-Position: refs/heads/master@{#405069} [add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/text/text-dir-auto-with-placeholder.html [add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-dir-auto-with-placeholder.html [modify] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/Source/core/html/HTMLElement.cpp
,
Jul 13 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/55f27bb5c4f4f99a2885dc67bd6e448a464505ed commit 55f27bb5c4f4f99a2885dc67bd6e448a464505ed Author: tkent <tkent@chromium.org> Date: Wed Jul 13 07:29:15 2016 Placeholder content direction should not affect INPUT/TEXTAREA direction. Skip -webkit-input-placeholder elements when we compute direction for dir=auto in HTMLElement::directionality. - Using <bdi> for placeholders doesn't work. We want to inherit placeholder direction from the parent element. - Using unicode-bidi CSS property doesn't work. It doesn't affect dir=auto computation. BUG= 623270 , 625739 Review-Url: https://codereview.chromium.org/2145823003 Cr-Commit-Position: refs/heads/master@{#405069} [add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/text/text-dir-auto-with-placeholder.html [add] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-dir-auto-with-placeholder.html [modify] https://crrev.com/55f27bb5c4f4f99a2885dc67bd6e448a464505ed/third_party/WebKit/Source/core/html/HTMLElement.cpp
,
Jul 13 2016
I think this was fixed with the current Canary channel. Clicking on the whitespace in the TEXTAREA puts the caret at the left side of the string. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by joh...@chromium.org
, Jun 27 2016