-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Enable RTL support for all inputs and textareas #26715
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
Conversation
I'm inclined to not fix the cases of hidden inputs or comments, just to reinforce that this attribute should always be set. BTW, this is a prime example why a |
خیلی ممنون. |
I think I'll actually do a pass and remove it from all inputs where type is hidden,checkbox,file. Any other types I missed? |
This reverts commit 504a509.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
נראה מעולה, תודה רבה!
Haven't read code or thought about it carefully. But I have a question about whether this approach is good enough: for future PRs, will there always be a person who are able to keep telling contributors "please add dir=auto" again and again? Some more thoughts:
|
I think best we can do is watch out for these in review. MutationObserver might be something to consider too, yes. I don't think djilint supports forbiding certain elements, but it'd be a nice feature to have. |
Would you like to take a try? Or I could try too. TBH, keeping asking contributors to add "dir=auto" doesn't look good to me. |
Not interested right now, this PR should be a simple attribute addition. I will do one pass to remove it from I think it's ideal to be correct without any JS involved. |
I will try to propose a MutationObserver solution. If there is no performance problem, I think that's the once and for all solution. |
Ready to review/merge now, diff is down to half after hidden/checkbox removal. |
Could we wait for more time? I do not think keeping adding attributes manually is maintainable. |
Try that I guess. Sadly it means RTL won't work without JS, but it would be the more maintainable solution via JS. |
Gitea UI already doesn't work without JS for long time. |
Well I blame it on the browser vendors for not making this attribute the default. Maybe they will see the light someday and we can remove the JS then. |
-> Add "dir=auto" for input/textarea elements by default #26735 |
#26735 has non-neglible performance impact, I think this solution is better. We don't have to meticulously have |
So I think I'm definitely done here, checked the diff twice, it's now down to +399 −398. |
#26735 has been fully rewritten, now it takes around 1.5ms on a PR page with +6966 -3615 (the rendered changed lines is around 3000) |
IDK, maybe we should just do it for the single markup textarea and be done with it, it seems that's exactly what GitHub is doing. Possibly all textareas. |
Closing in favor of #26735 |
Result of
There are likely a few superflous replacements, we need to review diff carefully.