Skip to content

Filters / ChoiceList filter does not focus the right option #2741

@loic-d

Description

@loic-d

Issue summary

When using a ChoiceList filter within the Filters component, selecting an option does not focus the right option.

I can reproduce the problem in the Polaris playground when selecting any option in the ChoiceList that is not the first one.

Screen Shot 2020-02-14 at 8 58 59 AM

Expected behavior

The selected option should be focused.

Actual behavior

The first option is selected.

Steps to reproduce the problem

I can reproduce on https://polaris.shopify.com/components/lists-and-tables/filters

  1. Click 'More filters'
  2. Select any of the 'Account status' option expect the first one
  3. The first option is focused

Note that I cannot reproduce the issue when using ChoiceList without Filters.

Reduced test case

The best way to get your bug fixed is to provide a reduced test case. This CodeSandbox template is a great starting point.

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: Last version I believe since I can reproduce in the Playground
  • Browser: Chrome Version 80.0.3987.106
  • Device: Mac
  • Operating System: Catalina

Or run npx envinfo --system --binaries --browsers --npmPackages react,react-dom,@shopify/polaris to provide specifications on your environment including version numbers, browser, device, and operating system.

Paste the results here:

Metadata

Metadata

Assignees

Labels

BugSomething is broken and not working as intended in the system.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions