Skip to content

4 events fired on collapse event #2923

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
stickeerehan opened this issue Mar 27, 2019 · 1 comment · Fixed by #2924
Closed

4 events fired on collapse event #2923

stickeerehan opened this issue Mar 27, 2019 · 1 comment · Fixed by #2924

Comments

@stickeerehan
Copy link

Operating system and version: Ubuntu 18.04.2 LTS
Browser and version: Chrome Version 73.0.3683.86 (Official Build) (64-bit)
Version of BootstrapVue that you are using: 2.0.0-rc.15
Example: https://jsfiddle.net/vzotdshw/1/

When listening for the bv::collapse::state event, looks like it's being fired off 4 times (see console). This I believe is a bug as I would expect it to trigger only once.

@tmorehouse
Copy link
Member

tmorehouse commented Mar 27, 2019

This was put in place because of #1798 (and PR #2102)

The state root event is emitted whenever the collapse is updated (in the updated hook) to ensure the collapse class persists on the toggle button due to component updating.

the bv::collapse::state event was really meant to be an internal only event for updating the state of the toggle button(s), but unfortunately made it's way into the documentation.

We might be able to find a better way of persisting the collapsed class in the v-b-toggle directive.

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