-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[CodeMirror] Autofocus Bug and suggestions #20228
Comments
Well I hardly see how multiple editors can get focus at the same time... |
magic |
@dgrammatiko Like that If you need this component. I'm doing it now, but you can test it. Immediately say if you turn off autofocus then there is no problem The case where two or more editors on one page is of course rare, but the bug is a bug |
Sorry but if you get both editors focused at the same time something is utterly wrong! Focus (and blur) are more than the visual indication eg, focused element is the one that tab key will leave to go to the next one. So even if you somehow hacked the visual part you totally destroyed the keyboard navigation (and probably a few more things) |
I did not hacked anything. I just output 3 editors on one tab in my component(I need this). Output using standard code using xml and geInput function Maybe here? or Maybe here? And if using this plugin does not work correctly, then this is a bug. Or to output two editors in one tab Joomla breaking something? Personally, I have never read about this. Moreover, I have never done this without the use of Joomla and there were no problems. If the system allows you to output 2 editors on one page, then they should work correctly. Or not work at all. |
Define what is correct, because focusing simultaneously 2 elements in a page breaks the very fundamentals of the web: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus |
@dgrammatiko Forgive or excuse probably I incorrectly expressed. At me now the focus is established in 3 editions at once. And this is a bug. It is necessary that in one. Actual result3 editor focused together Expected resultOnly first editor focused |
Ok now we're in the same page, that's a bug |
@dgrammatiko Thank you. Sorry, I got a little excited. Just recently, joomla is very upsetting me in terms of bugs |
@okonomiyaki3000 Your expertise please. |
Cool. So we should decide if we want to autofocus on the first editor or not at all. I'm slightly leaning toward not at all but I don't have a strong opinion on it. |
from an a11y perspective autofocus can be bad http://www.brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/ |
For the component from the example, it's best to be However, it turns out that in this case the plugin settings will be ignored. By the way, maybe add autofocus to the xml attributes? Then the developer can adjust the focus himself and install it on the correct editor, or completely disable autofocus it in form. This can be done in override. In my turn out to be very flexible |
I agree with @Septdir. Adding autofocus to the xml attributes will be an excellent solution. |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/20228 |
closed as having Pull Request #20270. |
Bug
And once again it concerns two or more editors.
If there are two or more editors on the page, then focus all at once.
Actual result
3 editor focused together
Expected result
Only first editor focused
You can use this component for testing
Sentence.
In my opinion,
autofocus
option should beNo
by defaultI'll explain why:
The text was updated successfully, but these errors were encountered: