Skip to content

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

@MengLinMaker

Description

@MengLinMaker

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();
	});

Metadata

Metadata

Assignees

No one assigned

    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