Environment
- Package version(s):
"@blueprintjs/core": "^6.12.0",
"@blueprintjs/select": "^6.1.9",
- Operating System: macOS Version 26.3
- Browser name and version: Island 1.85.25 Chromium: 145.0.7632.117 (Official Build) (arm64)
Code Sandbox
Link to a minimal repro: https://codesandbox.io/p/devbox/exciting-payne-swcdjy
Steps to reproduce
- Create a
<Select /> component that's queryable and has a couple menu items with shouldDismissPopover={false}
- Click them - expect popover to not close
- Move selection using arrow keys up and down - works fine
- Hit enter - expect popover to not close, but it closes
Actual behavior
- Popover closes when
shouldDismissPopover is false and you press Enter
Expected behavior
- It stays open and respects the prop
Possible solution
We check the event.target here in order to see if the menu/menu item has the popover dismissal class on it. When pressing enter, the event.target is actually the input box, not the menu item, so the rest of the code in this block doesn't search correctly. Not sure exactly what the right traversal is to fix this, but this is clearly where the bug is.
|
const target = event?.target as HTMLElement; |
Environment
"@blueprintjs/core": "^6.12.0",
"@blueprintjs/select": "^6.1.9",
Code Sandbox
Link to a minimal repro: https://codesandbox.io/p/devbox/exciting-payne-swcdjy
Steps to reproduce
<Select />component that's queryable and has a couple menu items withshouldDismissPopover={false}Actual behavior
shouldDismissPopoveris false and you press EnterExpected behavior
Possible solution
We check the
event.targethere in order to see if the menu/menu item has the popover dismissal class on it. When pressing enter, theevent.targetis actually the input box, not the menu item, so the rest of the code in this block doesn't search correctly. Not sure exactly what the right traversal is to fix this, but this is clearly where the bug is.blueprint/packages/select/src/components/select/select.tsx
Line 309 in 45c4d0f