-
Notifications
You must be signed in to change notification settings - Fork 610
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
[Dropdown] Items with to
don't trigger on enter
keydown
#689
Comments
Every item of items should be an array. Your example set all in one array. |
I have provided only one group of items (
|
Ah sorry I missed that array. Yes it looks like a bug that should get |
@pozdnyakoff indeed it seems to have a bug. |
I've forked the nuxt/ui repo, and add a test within the docuentation sample example (this commit), [
{
label: 'Google',
to: 'https://www.google.com/',
external: true,
target: '__blank'
}
] on the simple chunk-2AGPK4FE.js:1449 [Vue warn]: Unhandled error during execution of native event handler
at <MenuItems class="relative focus:outline-none overflow-y-auto scroll-py-1 divide-y divide-gray-200 dark:divide-gray-700 ring-1 ring-gray-200 dark:ring-gray-700 rounded-md shadow-lg bg-white dark:bg-gray-800" static="" >
at <BaseTransition appear=true persisted=false mode=undefined ... >
at <Transition appear="" enterActiveClass="transition duration-100 ease-out" enterFromClass="transform scale-95 opacity-0" ... >
at <Menu as="div" class="relative inline-flex text-left rtl:text-right" onMouseleave=fn<onMouseLeave> >
at <Dropdown items= (2) [Array(1), Array(1)] mode="hover" popper= {placement: 'bottom-start'} >
at <DropdownExampleMode >
at <ComponentExample >
at <MDCRenderer body= {type: 'root', children: Array(17), toc: {…}} data= {_path: '/elements/dropdown', _dir: 'elements', _draft: false, _partial: false, _locale: '', …} tag="div" ... >
at <ContentRendererMarkdown value= {_path: '/elements/dropdown', _dir: 'elements', _draft: false, _partial: false, _locale: '', …} excerpt=false tag="div" >
at <ContentRenderer key=0 value= {_path: '/elements/dropdown', _dir: 'elements', _draft: false, _partial: false, _locale: '', …} >
at <PageBody prose="" >
at <Page>
at <[...slug] onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) {__v_skip: true} > >
at <RouteProvider key="/elements,dropdown" vnode= {__v_isVNode: true, __v_skip: true, type: {…}, props: {…}, key: null, …} route= {fullPath: '/elements/dropdown#usage', hash: '#usage', query: {…}, name: 'slug', path: '/elements/dropdown', …} ... >
at <RouterView name=undefined route=undefined >
at <NuxtPage>
at <Page>
at <Container>
at <Main>
at <Docs ref=Ref< Proxy(Object) {__v_skip: true} > >
at <LayoutLoader key="docs" layoutProps= {ref: RefImpl} name="docs" >
at <NuxtLayoutProvider layoutProps= {ref: RefImpl} key="docs" name="docs" ... >
at <NuxtLayout>
at <App key=3 >
at <NuxtRoot>
warn2 @ chunk-2AGPK4FE.js:1449
logError @ chunk-2AGPK4FE.js:1623
handleError @ chunk-2AGPK4FE.js:1615
callWithErrorHandling @ chunk-2AGPK4FE.js:1567
callWithAsyncErrorHandling @ chunk-2AGPK4FE.js:1573
invoker @ chunk-2AGPK4FE.js:9397
01:36:48.253 chunk-2AGPK4FE.js:1628 Uncaught TypeError: p8.click is not a function
at s2 (:3000/_nuxt/node_modules/.cache/vite/client/deps/@headlessui_vue.js?v=c9a869a4:1924:54)
at onKeydown (:3000/_nuxt/node_modules/.cache/vite/client/deps/@headlessui_vue.js?v=c9a869a4:99:9)
at callWithErrorHandling (:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-2AGPK4FE.js?v=c9a869a4:1565:18)
at callWithAsyncErrorHandling (:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-2AGPK4FE.js?v=c9a869a4:1573:17)
at HTMLDivElement.invoker (:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-2AGPK4FE.js?v=c9a869a4:9397:5) Full video: Steps i've done:
When click with mouse no error is thrown |
Looks like it is something with ULink. edit: looks like it is about the custom property on the NuxtLink |
The same problem exists with VerticalNavigation, where you can only focus elements with href |
I've made a PR to use |
This only fixes it for Dropdown, right? |
Would you mind opening a new issue for the VerticalNavigation? |
Imma do that, but i think the problem exists with every component based on ULink |
I haven't been able to reproduce with the VerticalNavigation neither with the Button, both clicking or pressing enter on focus works fine for both cases as links or button. That's why I need a new issue with a reproduction. |
i just realized that this is actually not related to my problem, sorry |
Version
@nuxt/ui: v2.8.1
nuxt: v3.7.1
Reproduction Link
https://stackblitz.com/edit/nuxt-ui-rn5ikw?file=app.vue
The text was updated successfully, but these errors were encountered: