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

[CLOSED] Adding input types to focusable elements #9476 #8816

Open
core-ai-bot opened this issue Aug 30, 2021 · 5 comments
Open

[CLOSED] Adding input types to focusable elements #9476 #8816

core-ai-bot opened this issue Aug 30, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by eliezerb
Thursday Nov 13, 2014 at 04:32 GMT
Originally opened as adobe/brackets#9915


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.


eliezerb included the following code: https://github.com/adobe/brackets/pull/9915/commits

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Nov 13, 2014 at 07:54 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by eliezerb
Thursday Nov 13, 2014 at 11:35 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Dec 02, 2014 at 23:54 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Dec 03, 2014 at 23:37 GMT


@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.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Dec 04, 2014 at 18:00 GMT


@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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant