palantir/blueprint

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

Open

#6,655 创建于 2024年1月16日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)TypeScript (20,263 star) (2,167 fork)batch import
Package: selectStatus: needs proposalType: bughelp wanted

描述

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

贡献者指南