Skip to content

Listbox flickering/snapping around when new selection is made #1761

@IsaacCloos

Description

@IsaacCloos

What component (if applicable)

Describe the bug
When a user is changing their selection in a <Listbox /> the popup repositions itself quickly before fading away.

To Reproduce
React Router 7.9.2 project, here's a MVP code snippet.

import { Divider } from '@/components/catalyst/divider'
import { Field, Label } from '@/components/catalyst/fieldset'
import { Heading } from '@/components/catalyst/heading'
import { Listbox, ListboxLabel, ListboxOption } from '@/components/catalyst/listbox'

const items = [
	{ id: 1, name: 'Release 1.0' },
	{ id: 2, name: 'Release 1.1' },
	{ id: 3, name: 'Release 2.0' },
	{ id: 4, name: 'Release 2.1' },
	{ id: 5, name: 'Release 3.0' }
]

export default function ExamplePage() {
	return (
		<>
			<Heading>Example Page</Heading>
			<Divider className='mt-6 mb-8' />
			<Field>
				<Label>Lisbox MVP</Label>
				<Listbox defaultValue={3}>
					{items.map((item) => (
						<ListboxOption
							key={item.id}
							value={item.id}
						>
							<ListboxLabel>{item.name}</ListboxLabel>
						</ListboxOption>
					))}
				</Listbox>
			</Field>
		</>
	)
}

Behaves like this:

Image

Expected behavior
I recorded how the doc site works (which is very nice):

Image

Browser/Device (if applicable)

  • OS: Windows 11
  • Browser: chrome
  • Version: 140.0.7339.186

Additional context
I am using the latest version of catalyst (downloaded this morning).

Thanks for the help! If I'm using the component wrong sorry for the hassle 🙂

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions