nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Autocomplete and Select in Popover is buggy

Open Aryan-mor opened this issue 2 years ago • 13 comments

NextUI Version

2.4.0

Describe the bug

When I use Autocomplete and Select in a Popover and then select an item, the Popover closes, causing me to lose the state of the theme. The Popover should remain open when I choose an item from Autocomplete or Select.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Click on Popover
  2. Click on the Autocomplete inside the Popover
  3. Select an item from the Autocomplete

Expected behavior

After selecting an item from Autocomplete or Select, only that list should close, and the Popover should remain open.

Screenshots or Videos

https://github.com/nextui-org/nextui/assets/22844436/34b46866-b61e-416d-a880-f0ecb7a59798

But it works on V2.3.6 You can see the same actions with NextUi V2.3.6 in this video

https://github.com/nextui-org/nextui/assets/22844436/552aee0e-cc44-4ab4-88ab-f3f96d4f194f

Operating System Version

windows

Browser

Edge

Aryan-mor avatar May 30 '24 11:05 Aryan-mor

I am facing the similar issue

when I use Select or AutoComplete in a modal

I am not able to select an item using the mouse, and clear is also not working

Version 2.3.6 was working, but after updating to 2.4.0, it is not working. Rolling back to version 2.3.6 also does not work anymore.

sauravhathi avatar May 30 '24 12:05 sauravhathi

Rolling back to version 2.3.6 also does not work anymore.

@sauravhathi you may remove your node_modules and reinstall.

wingkwong avatar May 30 '24 13:05 wingkwong

@wangly19 i tryed many times but not wokring

When I select items using the mouse, it's not working, but when I try using Enter, it's working.

I prefer if you could try Select or AutoComplete in a modal you'll face same issue in 2.3.6 and 2.4.0

sauravhathi avatar May 30 '24 13:05 sauravhathi

@sauravhathi Did you remove ^ from the start of the version?

Aryan-mor avatar May 30 '24 14:05 Aryan-mor

@Aryan-mor Thanks! It works

sauravhathi avatar May 30 '24 15:05 sauravhathi

yup, just ran into this as well (after banging my head against the wall for a while so thanks for the sanity check with this ticket)

after running through the 2.4 release notes, my best guess of the cause is a regression in this popover PR cc @wingkwong

pdevito3 avatar Jun 04 '24 03:06 pdevito3

@pdevito3 yes i'm working on it. sorry for any inconvenience caused.

wingkwong avatar Jun 04 '24 03:06 wingkwong

All good! Appreciate the support and all the contributions 🍻

pdevito3 avatar Jun 04 '24 04:06 pdevito3

When the Select is used inside a modal, I cannot select an item (even the hover effect doesn't show up). Not sure how much related but i'll drop my drawer component. (i can reproduce it within this drawer.)

import * as Dialog from '@radix-ui/react-dialog'
import { ReactNode } from 'react'
import { cn } from '../../lib/utils/misc'
import { UseDisclosureProps } from '@nextui-org/react'

export default function Drawer(props: {
   trigger: ReactNode
   children: ReactNode
   className?: string
   disclosure?: UseDisclosureProps
}) {
   return (
      <Dialog.Root {...props.disclosure} open={props.disclosure?.isOpen}>
         <Dialog.Trigger asChild>{props.trigger}</Dialog.Trigger>

         <Dialog.Overlay className="!fixed z-30 inset-0 bg-black/40 flex justify-end " />
         <Dialog.Content
            className={cn(
               '!fixed inset-y-0 right-0 h-dvh w-full max-w-4xl p-10 py-12 bg-white z-30 focus:outline-none overflow-y-auto',
               props.className,
            )}
         >
            {props.children}
         </Dialog.Content>
      </Dialog.Root>
   )
}

laneme avatar Jun 06 '24 11:06 laneme

still bug in [email protected] with vaul

xmsz-stu avatar Feb 14 '25 15:02 xmsz-stu

Yup, same here. Not sure why this is closed

pdevito3 avatar Feb 14 '25 16:02 pdevito3

hitting this on v2.7.4

alocke12992 avatar Mar 08 '25 01:03 alocke12992