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

ember-bootstrap 4.4.0 issue with DOM node order using Contextual Help components and @triggerElement #1329

Closed
alexdiliberto opened this issue Nov 9, 2020 · 0 comments · Fixed by #1369
Labels

Comments

@alexdiliberto
Copy link
Contributor

ember app showing the issue: https://github.com/alexdiliberto/ember-bootstrap-undefined-trigger-element

The issue here for ember-bootstrap v4.4.0 is basically a DOM node order/timing issue.

This occurs if your use case needs to render the ember bootrap contextual help component (Example: BsTooltip) earlier in your template/DOM order than its corresponding trigger element. Some users may not have the ability to control their DOM order in all circumstances, and this would be a breaking change for them in this case when upgrading from v4.3.0 to v4.4.0

previously in v4.3.0, we executed getTriggerTargetElement in didInsertElement https://github.com/kaliber5/ember-bootstrap/blob/v4.3.0/addon/components/bs-contextual-help.js#L726, this allowed the full page to render before firing so the issue never presented itself.

Now with v4.4.0, we execute getTriggerTargetElement in the {{did-insert this.setup}} modifier named from bs-tooltip.hbs https://github.com/kaliber5/ember-bootstrap/blob/v4.4.0/addon/components/bs-contextual-help.js#L693. This fires inline at the exact moment in time the modifier is evaluated so anything waiting to be rendered in DOM later page order would not be rendered yet and will throw this error at runtime

Uncaught (in promise) Error: Assertion Failed: Could not find trigger element for tooltip/popover

Please help advise a solution here. Thanks!


Output from ember bootstrap:info:

$ ember bootstrap:info
Npm packages:
ember-bootstrap: ^4.4.0 -> 4.4.0
ember-cli: ~3.15.1 -> 3.15.2
bootstrap: ^4.3.1 -> 4.5.3
bootstrap-sass: n/a
ember-cli-sass: n/a
ember-cli-less: n/a
Bower packages:
bootstrap: n/a
bootstrap-sass: n/a
ember-bootstrap configuration:
bootstrapVersion: 4
importBootstrapCSS: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants