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: show event fires even though show is prevented because other element is transitioning #14844

Closed
jkrehm opened this issue Oct 22, 2014 · 5 comments

Comments

@jkrehm
Copy link

jkrehm commented Oct 22, 2014

I just noticed that if you click fast enough (within the 350 millisecond transition window) you can open two panels at once. I did this accidentally, not trying to troll my own application. The issue was previously resolved via #2941 and works well in 2.3.2, but was re-broken in 3.0 because the .in class is not added until the transition completes (as opposed to 2.3.2 where it's added immediately). You can observe the behavior on Bootstrap's document site. Expand the third pane then click panes 2 & 1 quickly. Panes 1 & 2 will open.

The straight-forward fix is pretty simple, I think. Instead of only checking for the .in class for "actives", check for .in and .collapsing, e.g.

var actives = this.$parent && this.$parent.find('> .panel > .in, > .panel > .collapsing')

However, if that's the only change made, the "show" event is still triggered for the element, even though it's not going to continue to the end. So anything listening for the "show" event (e.g. something to toggle an icon or background color) will fire erroneously. Commit 13cad50 made the event trigger before both this check and the isDefaultPrevented check, so I'm guessing the author had a reason, but I don't know what it is, so don't want to submit a pull request.

I'm using Chrome 38 on Mac OS Yosemite to test this. Let me know what other information might be useful.

@cvrebert
Copy link
Collaborator

Duplicate of #13447. Please search more next time.
Should already be fixed in master thanks to #14353.

@cvrebert cvrebert added the js label Oct 22, 2014
@jkrehm
Copy link
Author

jkrehm commented Oct 22, 2014

Sorry, I did search, which is how I found the ticket that I referenced. I saw no open tickets on the issue, otherwise I would not have wasted my time researching and filling out this issue.

@jkrehm
Copy link
Author

jkrehm commented Oct 22, 2014

However, I don't see what in that ticket would deal with the "show" event getting triggered even though the panel won't be shown. I can't be the only person who listens for that event in order to change a style or perform some other action.

@hnrch02 hnrch02 reopened this Oct 22, 2014
@hnrch02 hnrch02 added this to the v3.2.1 milestone Oct 22, 2014
@hnrch02 hnrch02 changed the title Multiple panels open in the Accordion Collapse: show event fires even though show is prevented because other element is transitioning Oct 22, 2014
@jkrehm
Copy link
Author

jkrehm commented Oct 22, 2014

Awesome, thanks so much for looking into this issue.
On Oct 21, 2014 7:29 PM, "Heinrich Fenkart" notifications@github.com
wrote:

Closed #14844 #14844 via e811a24
e811a24
.


Reply to this email directly or view it on GitHub
#14844 (comment).

@dominicarrojado
Copy link

This still happens to me. Is it different if I'm using Meteor.js?

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

Successfully merging a pull request may close this issue.

4 participants