mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.19k stars 508 forks source link

Impossible to Tab beyond an interactive example #6267

Open Ryuno-Ki opened 3 years ago

Ryuno-Ki commented 3 years ago

When Tabbing through http://localhost:5000/en-US/docs/Web/HTML/Element/input/text I can't leave the iFrame of Mozilla Demo using Tab.

Instead the key is used inside the HTML editor there.

bershanskiy commented 3 years ago

@Ryuno-Ki I agree that people should be able to navigate outside of the editor via a key press (for convenience and accessibility). However, I believe it's the expected behavior that Tab key creates a Tab when pressed within the editor. Perhaps, there should be a key combination that behaves like regular Tab when pressed within the editor?

Ryuno-Ki commented 3 years ago

Hm, looking through fitting WCAG or ARIA examples, I think, it would be application role.

For this, I could imagine leaving the demo by hitting <Esc> and offering a way to jump over it just before the Mozilla Demo is injected could be a good option.

Malvoz commented 2 years ago

Is it important to have tabs within the editor? If not the editor could simply be a contenteditable element?

sideshowbarker commented 2 years ago

Closing, as it seems this became moot after the move to Yari and away from the wiki system

Malvoz commented 2 years ago

@sideshowbarker I don't quite follow your comment. Did you misinterpret this issue perhaps? This is about the focus trap in the editor, which is still present, i.e.:

  1. visit https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/text#try_it
  2. click the editor box
  3. can't escape the editor using e.g. Tab
Malvoz commented 2 years ago

Or should I open a new issue, in this repo or elsewhere?

sideshowbarker commented 2 years ago

Did you misinterpret this issue perhaps?

Yes, I did. Re-opening and moving to the yari repo

caugner commented 1 year ago

I was able to reproduce this as follows:

  1. Go to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text
  2. Press Tab repeatedly, until the interactive example has focus and we're in the HTML editor.
  3. Pressing Tab again adds a Tab stop inside the editor.