Skip to content
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

Forced focus to example textbox on every (?) page can't be escaped? #593

Closed
tshinnic opened this issue Jul 25, 2021 · 5 comments · Fixed by #598 or #690
Closed

Forced focus to example textbox on every (?) page can't be escaped? #593

tshinnic opened this issue Jul 25, 2021 · 5 comments · Fixed by #598 or #690
Assignees
Labels
p1 We will address this soon and will provide capacity from our team for it in the next few releases.

Comments

@tshinnic
Copy link

First noticed as inability to move backwards/forwards in page history. Then realized that tab/shift-tab would not let me escape the initial example textbox. Only mouse interaction to focus outside the textbox would allow tabbing to other controls or using alt-leftarrow or alt-rightarrow to action page history.

Example page would be String.prototype.codePointAt()

  • Why is there a forced focus on page load or refresh on any initial example textbox?

  • Why is there no mechanism to escape once focused in the textbox?

This is beyond inconvenient but also quite against accessibility?

(this on Chrome 91, Edge 92, FF 90 and Win10)

@wbamberg
Copy link
Collaborator

I believe that this is intentional, to help show that the examples are editable. But it's probably not actually very effective, and I agree with you that it has ugly side effects. We should stop doing it.

@mdn/core-dev , please could you transfer this to mdn/yari?

@peterbe peterbe transferred this issue from mdn/content Jul 27, 2021
@peterbe peterbe transferred this issue from mdn/yari Jul 27, 2021
@peterbe
Copy link
Contributor

peterbe commented Jul 27, 2021

@schalkneethling I transferred this issue to here. Seems like a pretty significant bug.

@schalkneethling schalkneethling self-assigned this Jul 29, 2021
@schalkneethling schalkneethling added the p1 We will address this soon and will provide capacity from our team for it in the next few releases. label Jul 29, 2021
@tshinnic
Copy link
Author

tshinnic commented Aug 4, 2021

What does use of this option do?

autofocus: boolean
Can be used to make CodeMirror focus itself on initialization. Defaults to off.

Apparently original code from 3+ years ago, perhaps something recently changing elsewhere has caused this effort to surface so obtrusively? Perhaps experimenting with that option commented out so that it can default to 'false' would be worth a try?

@peterbe
Copy link
Contributor

peterbe commented Aug 4, 2021

@schalkneethling Can you please test to turn that to false and see how it behaves?

@peterbe
Copy link
Contributor

peterbe commented Aug 4, 2021

This bug is so annoying that when you go to https://developer.mozilla.org/en-US/docs/MDN/Kitchensink it always automatically scrolls you down to this interactive example:
Screen Shot 2021-08-04 at 12 58 21 PM

peterbe pushed a commit that referenced this issue Aug 16, 2021
Do not auto focus JS editor

fix #593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 We will address this soon and will provide capacity from our team for it in the next few releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants