Skip to content
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

[BUG] - Dropdown closes on scroll even with shouldCloseOnScroll: false #4325

Open
AnYiEE opened this issue Dec 11, 2024 · 10 comments
Open

[BUG] - Dropdown closes on scroll even with shouldCloseOnScroll: false #4325

AnYiEE opened this issue Dec 11, 2024 · 10 comments
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@AnYiEE
Copy link
Contributor

AnYiEE commented Dec 11, 2024

NextUI Version

2.6.7/2.6.8

Describe the bug

Upgrading from 2.6.5 to the above two versions, when setting shouldBlockScroll to false, the Dropdown will close when scrolling, even if shouldCloseOnScroll is set to false.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Set shouldBlockScroll to false, set shouldCloseOnScroll to false.

Expected behavior

The Dropdown will not be closed when scrolling.

Screenshots or Videos

No response

Operating System Version

Windows

Browser

Chrome

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels Dec 11, 2024
@wingkwong
Copy link
Member

seems introduced from #4288

@AnYiEE
Copy link
Contributor Author

AnYiEE commented Dec 11, 2024

For #4251 and #4290, I still think they are the same issue, as they are both Popover-based components, and fixing only #4288 is not comprehensive.

@AnYiEE
Copy link
Contributor Author

AnYiEE commented Dec 11, 2024

@wingkwong When I tried to reproduce it on the document page, I saw that https://nextui.org/docs/components/dropdown#dropdown-props listed PopoverProps. I remember it wasn't like this before, and the Dropdown component actually doesn't have a prop named PopoverProps. There are also no related controls in the storybook at https://storybook.nextui.org/?path=/story/components-dropdown--default

@wingkwong
Copy link
Member

I remember it wasn't like this before, and the Dropdown component actually doesn't have a prop named PopoverProps.

There is no such prop called PopoverProps. If you look at the note,

Since the dropdown is an extension of the popover, it accepts all the props of the popover component

What it means is you can use those props from PopoverProps, which are listed in https://nextui.org/docs/components/popover#popover-props

@AnYiEE
Copy link
Contributor Author

AnYiEE commented Dec 11, 2024

What it means is you can use those props from PopoverProps, which are listed in https://nextui.org/docs/components/popover#popover-props

But the Dropdown storybook is missing popover related props too, no options to control when previewing.

@ryo-manba
Copy link
Member

ryo-manba commented Dec 12, 2024

It seems that this issue already occurs with @nextui-org/react: "2.4.8".
It is not a problem introduced after version 2.6.5.
See: https://stackblitz.com/edit/vitejs-vite-2xwku3js?file=package.json

@ryo-manba ryo-manba changed the title [BUG] - After upgrading from 2.6.5 to 2.6.7, the Dropdown is always closed when scrolling [BUG] - Dropdown closes on scroll even with shouldCloseOnScroll: false Dec 12, 2024
@ryo-manba
Copy link
Member

Please create a separate issue for problems that are not related to this one.

@AnYiEE
Copy link
Contributor Author

AnYiEE commented Dec 12, 2024

@ryo-manba
Copy link
Member

That's a strange. I tried it with 2.6.5, but it doesn't work.
See: https://stackblitz.com/edit/vitejs-vite-uheqs3du?file=src%2FApp.tsx

Could you create a minimal reproduction? It would help us resolve the issue faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants