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

Listbox scrolls to the selected option and does not allow to display the rest. #3674

Open
Allorentee opened this issue Mar 25, 2025 · 0 comments

Comments

@Allorentee
Copy link

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

@headlessui/[email protected]

What browser are you using?

For example: Chrome, Safari, or N/A

Reproduction URL

I have created an example so that the issue can be tested.

Reproduce: Reproduce listbox options

Here is the visualisation of how it scrolls to the selected option without displaying the rest of the options

Screenshot 2025-03-25 at 22 08 07

Describe your issue

Hii, the other day using the Listbox component I found something irregular.

this component when the options are cleared and you don't have enough space in the screen to show them, it makes a scroll towards the selected option.

The problem is when you have 5 or more options and you have selected the second one, when you deploy the options, it scrolls to the second option which is the selected one but does not allow you to view the rest or scroll because it blocks the scroll of the page, it scrolls to the selected option and the options do not have space on the screen to be displayed, it scrolls to the selected option after the scroll is blocked.

I would like to make a pr to make the component scroll to the last visible option.

Ty for read me!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant