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

Collapse - do not prevent event for input #22272

Merged
merged 1 commit into from
Mar 27, 2017
Merged

Conversation

Johann-S
Copy link
Member

@Johann-S Johann-S commented Mar 25, 2017

Stop preventing event for input in Collapse

/CC @mdo and @bardiharborow

Fixes #22049, fixes #21079

@mdo mdo added this to the v4.0.0-beta milestone Mar 26, 2017
@mdo
Copy link
Member

mdo commented Mar 26, 2017

Seems fine by me!

@@ -363,7 +363,9 @@ const Collapse = (($) => {
*/

$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
event.preventDefault()
if (!$(event.target).is('input')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably want this test instead /input|textarea/i.test(event.target.tagName).
It include the case of both textarea and input plus it avoid doing a JQuery dom selection.
Also it's more consistent with the code in other plugins

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes thank you @vanduynslagerp ! That's the regex I looked for but didn't found it 😄

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.

3 participants