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(combobox): old dropdown options shown on blur #514

Open
MengLinMaker opened this issue Nov 2, 2024 · 0 comments · May be fixed by #526
Open

bug(combobox): old dropdown options shown on blur #514

MengLinMaker opened this issue Nov 2, 2024 · 0 comments · May be fixed by #526

Comments

@MengLinMaker
Copy link
Contributor

MengLinMaker commented Nov 2, 2024

Firstly, is this a bug or feature? - code appears to be written intentionally

Describe the bug

When combobox & search (which uses combobox) blurs, the old options are shown temporarily.

There are 2 sources of truths for displayed options:

  • local.options provided through props
  • lastDisplayedOptions used internally to "Prevents the popover contents from updating as the combobox closes"

But this leads to janky behaviour as the popover content closes - especially on animation.

To Reproduce

  1. Type something into combobox - with results
  2. Change input - with different results
  3. Click outside combobox to blur - observe

Slow down css animation to see the jank

unexpected.mp4

Expected behavior

Close without content changing:

expected.mp4

Additional context

Location of code behaviour combobox-base.tsx:

	const displayedOptions = createMemo(() => {
		if (disclosureState.isOpen()) {
			if (showAllOptions()) {
				return local.options!;
			}
			return filteredOptions();
		}
		return lastDisplayedOptions();
	});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant