palantir/blueprint

Select does not allow direct selection of last item in scrollable menu

Open

#6655 opened on Jan 16, 2024

View on GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
Package: selectStatus: needs proposalType: bughelp wanted

Description

Environment

  • Package version(s): 5.7.2
  • Operating System: MacOS 13.6.3
  • Browser name and version: Chrome 120.0.6099.216

Repo

Repro exists in Blueprint doc's Select component example.

https://github.com/palantir/blueprint/assets/2968519/7eb86ea7-0cec-49fd-8150-a2f440de667d

Steps to reproduce

  1. Have a <Select> component with the default configuration (as exemplified in the docs) and with more than 10 items (such that the dropdown menu overflows)
  2. Attempt to click either the first or last item while already scrolled into the dropdown menu.
  3. Note that the first click does not register as a selection

Actual behavior

In the <Select> component, the first click on the first or last item in a scrolled menu does not register as a click/selection in the component, rather it is treated as a scroll. Clicks in the middle of the menu do not have this issue / operate as expected.

Expected behavior

This behavior is confusing, especially since the menu item still receives selection styles in the list (blue/primary highlight) but is not actually selected by the Select.

https://github.com/palantir/blueprint/assets/2968519/d6a4f8ea-1230-4b55-af54-6b5cb1718ebe

Possible solution

Contributor guide