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

Must hide tooltips before re-rendering or they'll persist after eleme… #2889

Closed

Conversation

JDutil
Copy link
Contributor

@JDutil JDutil commented Oct 3, 2018

…nts removed from DOM.

refs #2864

The issue with tooltips persisting on line item form is caused by the original tooltip element being removed from the DOM when the templates re-rendered after clicking an action. The recommended workaround for this is to first hide your tooltip before removing the elements from the DOM: twbs/bootstrap#2298

I haven't browsed around looking for this issue in other spots, but it wouldn't surprise me if there are other instances of this to fix. Would like to get feedback on this solution before checking for other places to fix.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Hey Jeff! Great to have you back.
Thanks for the fix.

We should use the .tooltip('destroy') method instead. Otherwise all events will still be bound in memory.

See twbs/bootstrap#3880

@JDutil
Copy link
Contributor Author

JDutil commented Oct 3, 2018

@tvdeyen Thanks. I get an error trying to use destroy it looks like it was renamed dispose at some point, but that appears to work as intended for unbinding events.
https://github.com/twbs/bootstrap/blob/v4-dev/js/src/tooltip.js#L212

I also noticed this is happening all over the place so going to make a pass through the admin to see where else needs to be fixed before this is merged.

@kennyadsl
Copy link
Member

Could this be related to #2421 ?

@JDutil JDutil force-pushed the hotfix/28674-fixes-line-item-tooltips branch from 005b9a5 to 1382b69 Compare October 3, 2018 20:18
@JDutil
Copy link
Contributor Author

JDutil commented Oct 3, 2018

@kennyadsl yea it looks like it. I'll probably close this in favor of fixing in that file so solution works everywhere, but my initial attempts don't seem to work.

@JDutil
Copy link
Contributor Author

JDutil commented Oct 3, 2018

Closed in favor of #2890

@JDutil JDutil closed this Oct 3, 2018
@JDutil JDutil deleted the hotfix/28674-fixes-line-item-tooltips branch October 23, 2018 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants