Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Flipswitch widget and tab key #6955

Closed
DickvdBrink opened this issue Jan 16, 2014 · 10 comments
Closed

Flipswitch widget and tab key #6955

DickvdBrink opened this issue Jan 16, 2014 · 10 comments

Comments

@DickvdBrink
Copy link
Contributor

Tabbing from an input to the new flipswitch widget doesn't really work.
Tabbing to the (deprecated) slider widget does work as expected.

Example:
http://jsfiddle.net/P68fy/1/

Note: A lot of demo's have a header where they say it is using a flipswitch widget, but the deprecated slider is used instead.

@arschmitz
Copy link
Contributor

Thank you for reporting this what exactly do you mean by you cant tab to it? i can tab to the all controls in your demo though the tab order does seem to be incorrect.

@arschmitz
Copy link
Contributor

also see http://demos.jquerymobile.com/1.4.0/flipswitch/ it contains MANY flipswitchs all of which are tabbable in the correct order.

@DickvdBrink
Copy link
Contributor Author

What i mean is that when I'm on the input, the first tab key moves it to the flipswitch input, instead of the flipswitch button.

Note: When you click the flipswitch button, you can move it with the left/right key but not when tabbing to (from the input)

The demo link you gave is correct, the tab key does work, but only when clicking the flipswitch the first time. After clicking all the other buttons (the view source buttons) are skipped when using the tab key.

@gabrielschulhof
Copy link

@arschmitz I can copy the reassign-tabindex-from-input-to-widget code from slider.

@arschmitz
Copy link
Contributor

@gabrielschulhof we should do that however i dont think thats the issue here because there is no explicitly set tabindex

@gabrielschulhof
Copy link

@arschmitz that doesn't mean the input is not tabbable. IINM, it is getting focus, but the focus is not being transferred to the visible parts of the widget.

@gabrielschulhof
Copy link

@arschmitz So the focus-transferring code still needs to be there.

@DickvdBrink
Copy link
Contributor Author

Note: The flipswitch widget is setting tabindex to 1, for the button by default.
see: https://github.com/jquery/jquery-mobile/blob/master/js/widgets/forms/flipswitch.js#L93

@ghost ghost assigned gabrielschulhof Jan 16, 2014
@gabrielschulhof
Copy link

@DickvdBrink Yeah, it's currently hard-coded. We'll make that nicer by copying the code I referred to above to the flipswitch widget.

gabrielschulhof pushed a commit that referenced this issue Jan 17, 2014
The "on" button must be an anchor for it to be focusable just like an input even
when it does not have an explicitly set tabindex. Although the input becomes
unfocusable, a focus handler that transfers focus to the "on" button is
nevertheless attached to it in case third-party code focuses the input manually.

Fixes gh-6955
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants