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

fix(Popover): avoid crash on mount if ref not loaded #105

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Conversation

smarroufin
Copy link
Collaborator

Fixes #100

Verified

This commit was signed with the committer’s verified signature.
matthewnessworthy Matthew Nessworthy
@vercel
Copy link

vercel bot commented Oct 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ui ✅ Ready (Inspect) Visit Preview Oct 25, 2022 at 3:27PM (UTC)

@netlify
Copy link

netlify bot commented Oct 25, 2022

Deploy Preview for nuxthq-ui canceled.

Name Link
🔨 Latest commit a597316
🔍 Latest deploy log https://app.netlify.com/sites/nuxthq-ui/deploys/635800414f073900091ec6a6

@@ -77,7 +78,7 @@ onMounted(() => {
const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides)
popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]]
// stop trigger click propagation on hover
popoverApi.value.button.addEventListener('click', (e: Event) => {
popoverApi.value?.button?.addEventListener('click', (e: Event) => {
Copy link
Member

Choose a reason for hiding this comment

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

Why is the ref called button here and buttonRef in Dropdown?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's what I asked myself, weird but this is how they wrote it 🤷
And that's also why I added the Headless component API GitHub link.

@benjamincanac benjamincanac merged commit e9f0224 into dev Oct 26, 2022
@benjamincanac benjamincanac deleted the fix/100 branch October 26, 2022 09:57
benjamincanac pushed a commit that referenced this pull request Jul 24, 2024
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.

[Popover] addEventListener null
2 participants