-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix relative icon position with dir='rtl' #1021
Conversation
I've tested this on several RTL login pages and it does much better than current master. 👍 The current code will fail in the (weird case) of Remember that RTL is actually about the order in which characters are displayed and only implicitly about text alignment, but the correct icon position depends only on the text-alignment. I've done some tests about mechanisms and relative priorities of doing RTL with HTML/CSS. From highest priority to lowest:
For example, one site has input |
Nothing like consistency! |
@anon324875693 One more issue: if the input field has a parent EDIT: But this is gonna cause multiple number of getComputedStyle() calls, so it's not a wise decision to traverse all the parents for each icon. Lets skip that for now. |
I think that's reasonable. Though again, I believe you'd only need to do the parent traversal once per input since directions/alignment should be fixed after load. By and large all the RTL sites I've seen so far always have an explicit text-align property on the input element. probably to protect against any cross-browser weirdness. |
Merge? |
13a4024
to
ad8740a
Compare
#840 broke the icon position with right-to-left pages.
Also adds
text-align: right
anddir=rtl
detection to Icon constructor.Fixes #1019.