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

Have Carousel ignore keyboard events from <input>s or <textarea>s #14993

Merged
merged 1 commit into from
Nov 5, 2014

Conversation

cvrebert
Copy link
Collaborator

@cvrebert cvrebert commented Nov 4, 2014

Fixes #14991.
/to @fat for review

@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 4, 2014

-1 per #14991 (comment).

@cvrebert
Copy link
Collaborator Author

cvrebert commented Nov 4, 2014

That's a fair point. I can see the merits of both sides and will be happy with whatever fat decides.

@cvrebert
Copy link
Collaborator Author

cvrebert commented Nov 4, 2014

If we ultimately reject this, then we should document more explicitly that forms aren't supported in Carousels.

@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 4, 2014

Good point.

@@ -42,6 +42,12 @@
}

Carousel.prototype.keydown = function (e) {
var tagName = e.target.tagName.toUpperCase()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need toUpperCase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would maybe just change this to

if (/INPUT|TEXTAREA/.test(e.target.tagName)) return

@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 5, 2014

If we are considering merging this, it would be much easier to do it like this:

if ($(e.target).is('input, textarea')) return // or
if (/input|textarea/i.test(e.target.tagName)) return

@cvrebert
Copy link
Collaborator Author

cvrebert commented Nov 5, 2014

@fat Okay, simplified to @hnrch02's suggestion.

@hnrch02 hnrch02 added this to the v3.3.1 milestone Nov 5, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 5, 2014

:shipit:

cvrebert added a commit that referenced this pull request Nov 5, 2014
Have Carousel ignore keyboard events from <input>s or <textarea>s
@cvrebert cvrebert merged commit 2164432 into master Nov 5, 2014
@cvrebert cvrebert deleted the fix-14991 branch November 5, 2014 00:50
@hnrch02 hnrch02 mentioned this pull request Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carousel key events
3 participants