-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Tabindex] input navigation with TAB #3309
Conversation
passing tabIndex as attribute for the edittemplate inputs only (including codemirror) this can be tested |
Yes, please! I've been wishing for this for a while. It's a first step to making TW more keyboard-navigable. |
+1 |
Hi @pmario , thanks for the thumbs-up! I wanted to ask you about a codemirror-config detail: here is a codemirror issue with a solution for disabling the TAB key, which would enable TAB to jump from a codemirror editor to next/previous input. I'd like to make that configurable in the ControlPanel (and keep the default CM behaviour as default). Do you have an idea how to add this config? I've not been lucky trying |
@Jermolene, this one would be ready, I reopened it. This does the following:
|
Thanks @BurningTreeC does this undo #3490 or does that need to be done separately? |
@Jermolene , this does not undo #3490 |
More detailed explanation what this PR is supposed to achieve: This PR adds two attributes that can be used for the
the default tab-index for elements without an explicitely set tab-index attribute is 0 I'm using attributes here, because we don't want input fields that are within popups to cancel their own popup. Maybe we need a logic that #3490 introduced, thus, detecting if the input is within the popup that we're trying to cancel |
@BurningTreeC Nice work! I have some thoughts on this: For what it's worth, a single To be honest, I feel a little uneasy about the explicit |
@hoelzro I think you're right about the popup mechanism I'll remove any popup handling from this PR and leave the |
closing this in favor of a clean PR |
Follow-Up of #3302
This now ONLY sets the tabindices of inputs and textareas within tiddlers to 1
Why 1?
Because the other elements have "0" which is default and the title gets focused automatically or by clicking, and
TAB
will then first cycle through all "1-level" elements and then jump to the base-level (or level 2 first [3 ... 4 ...], if it exists - but it doesn't here)The inputs and textareas of the EditTemplate tiddlers all get the new attribute
cancelPopups
that cancels all existing popups when they get focus (and then spawn their popup if so). Cannot set this on all inputs by default because of the link-dropdown in the toolbar which would cancel itself after opening.We could set
cancelPopups
on the search input, too - it'd be very comfortable there, tooThe tabindex currently is hard-coded withinsimple.js
andengine.js
- should we pass it as a widget-attribute?The check for "is the input within a tiddler?" may be undesired because it affects the ViewTemplates, too.Simply passing say
setTabIndex="1"
explicitly would be a possible solution and would allow to control these changes in a sane way.What do you think?