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

Adding input types to focusable elements #9476 #9915

Merged
merged 2 commits into from
Dec 2, 2014
Merged

Adding input types to focusable elements #9476 #9915

merged 2 commits into from
Dec 2, 2014

Conversation

eliezerb
Copy link
Contributor

This pull-request contains the patch to fix the issue #9476.

Making possible to the user give focus on input fields inside elements with no-focus class.

@peterflynn
Copy link
Member

As I mentioned on IRC, I think it would be much simpler but equally correct to just filter on $target.is("input") overall -- no need to check the type. On platforms where clicking e.g. a checkbox shouldn't give it focus, Chromium should already be behaving that way by default anyway, so it shouldn't matter if we don't call preventDefault() for it.

@eliezerb
Copy link
Contributor Author

@peterflynn Thanks for the tip. I replaced the specific input types with the general input tag. I think this matches with your suggestion.

@redmunds
Copy link
Contributor

redmunds commented Dec 2, 2014

It seems this code doesn't really do much anyway. It only applies to elements with no-focus class (i.e. doesn't apply to elements inside a no-focus element), and it only prevents mousedown (i.e. you can still Tab to element). This is all the more reason to simplify this code.

Thanks. Merging.

redmunds added a commit that referenced this pull request Dec 2, 2014
…lements

Adding input types to focusable elements #9476
@redmunds redmunds merged commit c70c652 into adobe:master Dec 2, 2014
@peterflynn
Copy link
Member

@redmunds It definitely does apply to elements inside a no-focus parent, because mousedown events bubble. We rely on that in many places, including the toolbars, status bar, and Find in Files results panel.

You're right that it does not affect tabbing, though. A better name for it might be .no-mousedown-focus -- although if we eventually implement global focus management to control tabbing, it could presumably look at the same CSS class, so maybe the more generic name is actually good for future-proofing.

@redmunds
Copy link
Contributor

redmunds commented Dec 4, 2014

@peterflynn

It definitely does apply to elements inside a no-focus parent...

You're right. I assumed that the test modal dialog I created was contained in a no-focus parent, but it wasn't.

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

Successfully merging this pull request may close these issues.

None yet

3 participants