Skip to content

Disabled browser default outline for listview buttons on focus #4303

Closed
wants to merge 1 commit into from

3 participants

@jaspermdegroot
jQuery Foundation member

Issue: Listview and custom selectmenu items still have the default browser outline on focus (together with box-shadow of ui-focus class) while outline is set to 0 for all other buttons. See #2214

Fix: Added .ui-link-inherit:focus selector to the .ui-btn:focus { outline: 0; } rule.

@toddparker

Good catch.

@scottjehl

Hmm, yes good catch but I don't think that's the only place ui-link-inherit is used. It's used for child links within other generic themed containers as well (ui-bar-a, etc). I'd suggest moving this rule to the listview and selectmenu plugins' CSS files and scoping to those plugins specifically so it doesn't affect accessibility for other links in the page. Make sense? If not, I can reopen the pull.

@scottjehl scottjehl closed this May 15, 2012
@jaspermdegroot
jQuery Foundation member

@scottjehl hi Scott,

Thanks for reviewing this PR!

I just checked the JS again and it seems to me that the framework only add the ui-link-inherit class in the listview widget. Also, it always concerns a link wrapped in .ui-btn (which gets the ui-focus box-shadow styling on focus).
Can you give me an example when a child link in a bar has ui-link-inherit?

If we move it to the specific CSS files, we should move the rule for .ui-btn:focus to the button.css as well. Removing it from the theme to structure CSS makes it harder for people to adjust the focus style to their own preferences.

What do you think about making the selector more specific? .ui-focus .ui-link-inherit:focus

@jaspermdegroot
jQuery Foundation member

@scottjehl - If you agree it's safe to use .ui-focus .ui-link-inherit:focus I will create a new PR for that. Seems easier that reopening this one.

@scottjehl scottjehl was assigned May 27, 2012
@jaspermdegroot
jQuery Foundation member

@scottjehl @toddparker - Do you agree with this change: .ui-btn:focus, .ui-focus .ui-link-inherit:focus { outline: 0; } ?

@toddparker

@uGoMobi - I'd like to see a demo page to give this idea some testing.

@toddparker

I just tested this in a few desktop browsers, iOS and Android and it looks great so this is ready to land. Excellent work, as always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.