Comments (1)
It refers to the code below. This is hacky and will stay that way since we have no other choice.
We consider 200ms enough to have everything mounted and introspect the headlessui component. In a few cases, this amount of time may not be enough.
It crashes on popoverApi.value.button.addEventListener
. So I will only secure it with null-checks ?
and that will be fine.
setTimeout(() => {
const popoverProvides = trigger.value?.$.provides
if (!popoverProvides) {
return
}
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) => {
if (props.mode === 'hover') {
e.stopPropagation()
}
}, true)
}, 200)
EDIT:
I've done it right in Dropdown but not in Popover. My bad.
from ui.
Related Issues (20)
- Nuxt Dev server broken after 2.16.0 update HOT 9
- Can we have resize component? HOT 1
- How to disable selection input in <UTable>? HOT 4
- Dropdown openDelay not working? HOT 5
- UButton - activeClass does not work when switching from another layout
- nuxt How to develop browser extensions HOT 1
- Missing USelectMenu selected option name HOT 9
- Problem with error message translations if use valibot in form HOT 2
- Hide wrapper of UInput when type="hidden"
- space between buttons in buttonGroup OR more styles for RadioGroup HOT 3
- Hide CommandPalette empty state not working HOT 1
- Allow URadio to accept a type of object
- Button group rounded corner SSR mismatch
- UToggle is not getting rerendered when v-model is getting from pinia store
- Loading property for UDropdown Items
- Breadcrumb: use custom action instead of link HOT 2
- Is it possible to use contextMenu on a Table?
- Nested attributes in objects
- Form Input attrs HOT 1
- Button Gray Outline HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui.