-
Notifications
You must be signed in to change notification settings - Fork 742
feat(Popover): add anchor
slot
#4119
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
Conversation
β¦into feat/popover-anchor
commit: |
This doesn't seem to work when using an Input in the <script setup lang="ts">
const open = ref(false)
</script>
<template>
<UPopover v-model:open="open">
<template #anchor>
<UInput placeholder="Search" class="w-56" @focus="open = true" />
</template>
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</UPopover>
</template> |
This is definitely caused by RekaUI's <script setup lang="ts">
const open = ref(false)
</script>
<template>
<UPopover v-model:open="open" :content="{ onFocusOutside: (e) => e.preventDefault() }">
<template #anchor>
<UInput placeholder="Search" class="w-56" @focus="open = true" />
</template>
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</UPopover>
</template> The other 2 ways I found were setting the What would be the best way to handle this? Should I just show it in the example for the users or perhaps some other solution? Maybe this is something to handle upstream... |
I like the idea of showcasing the anchor slot with an Input, we can go with |
I've updated the examples both in the docs and the playground. Seems to be working just fine, but the users will have to handle the closing logic by themselves... |
anchor
slot
Thanks! π |
Thank you all! |
π Linked issue
Resolves: #4013
β Type of change
π Description
I've added the
#anchor
slot to thePopover
component to allow users to position the content to other elements.Users requested the option to pass in an element that would be used as the anchor of the popover.
π Checklist