vue3-popper
vue3-popper copied to clipboard
How can we close the popper on something like a scroll event?
This is a great library, thanks for building it! I'm wondering how we can close the popper without implementing full manual control?
Problem: I need to close the popper on scroll, but want to retain the default open/close functionality of the component, so I don't want to eject to full manual control.
Thanks for this, I see your problem. Maybe it's possible to keep using the internal functionality while using v-model
or the .sync
modifier - that way you would keep all the default functionality while still being able to manually control the Popper.
I'll take a look at this.
Thanks! Yes the beauty of the component is that it implements all that default open/close functionality, which we wouldn't want to lose to be able to get some manual control.
i got the same issue (close popper manually without full open/close control), and this is my workaround:
<Popper :show="showPopper"> ... </Popper>
const hidePopper = () => { showPopper.value = false; nextTick(() => { showPopper.value = null; }); };
https://codesandbox.io/s/vue3-popper-manually-close-workaround-umrcf