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

Show help when stuck in tab index trap #2746

Merged
merged 7 commits into from
Dec 12, 2023
Merged

Show help when stuck in tab index trap #2746

merged 7 commits into from
Dec 12, 2023

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Dec 11, 2023

We use tab for autocomplete, which is a usability issue: if you use TAB to navigate a website, a codemirror acts as a "focus trap": it is not possible to focus on the next item.

Codemirror 6 addresses this issue by disabling tab-to-indent by default, but we enabled it anyways because it is the expected behaviour of an IDE. In that case, CM6 lets users focus on the next item using Escape - Tab, but as https://codemirror.net/examples/tab/ suggests, this should be clearly documented.

(FYI this does not happen when viewing a static Pluto document, we disable the Tab key handler in this case.)

I think the best way to document this is to detect the scenario and show documentation on-screen. I tried to use fancy CM6 API to do it :)

The help message will show when: a cell is focused, but not using a click or arrow-movement-across-cells (not implemented in the video below), and the first key that is pressed is Tab.

In this video, I navigate through the page using Tab, and also using my mouse, and you can see when the message shows up or not.

Schermopname.2023-12-11.om.15.32.54.mov

@fonsp fonsp added frontend Concerning the HTML editor accessibility Accessibility improvements of the frontend, like screen reader support and internationalization labels Dec 11, 2023
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="tab-index-trap-help")
julia> using Pluto

@fonsp
Copy link
Owner Author

fonsp commented Dec 11, 2023

cc @lukavdplas

@fonsp fonsp added the CM6 CodeMirror 6 label Dec 11, 2023
@lukavdplas
Copy link
Contributor

Nice! I would also add this to the instructions alert when you press F1.

@lukavdplas
Copy link
Contributor

By the way, something that would also help with clarity is if you add a button at the very top of the page to open the keyboard shortcuts menu. It can be moved out of view using absolute positioning, and moved in when it receives focus.

This is often done for skiplinks. For instance, https://www.belastingdienst.nl has several links like this. But I would say for a complex application, this would be an appropriate place to direct keyboard-only users to controls.

I'd be happy to add this if you want.

@fonsp fonsp merged commit 39bfaf1 into main Dec 12, 2023
3 checks passed
@fonsp fonsp deleted the tab-index-trap-help branch December 12, 2023 00:03
@fonsp fonsp added the autocomplete <TAB> label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Accessibility improvements of the frontend, like screen reader support and internationalization autocomplete <TAB> CM6 CodeMirror 6 frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants