-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
tooltip dispose:removing only own event handler #28896
Conversation
Hi @david-lallement, Can you create a live demo of the problem via CodePen/JS Bin or Stackblitz ? Because we already use event namespace of jQuery |
Hi Johann, |
Nice catch @david-lallement 👍 It seems your change broke our unit tests, please can you fix that ? |
Hi Johann, |
@Johann-S: when you merge this please adapt it for v4 and push it to my v4-dev-xmr branch |
Now it's fixed thanks @david-lallement 👍 you can see it here: https://codepen.io/Johann-S/pen/zVGmzZ and it'll be available in our next v4 release |
If the tooltip component is in a modal, only the listeners created by the tooltip component should to be removed in the dispose method.
For example, if we subscribe to the hide.bs.modal event of the modal component and call the dispose method of a tooltip component inside, the hide.bs.modal event subscription is lost.
Using of event namespace feature of jquery ensures that only the handler created in _setListeners function is removed in dispose function.