Skip to content

Select MenuItems dont respect shouldDismissPopover={false} when selected with Enter #8079

@bradymadden97

Description

@bradymadden97

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

  1. Create a <Select /> component that's queryable and has a couple menu items with shouldDismissPopover={false}
  2. Click them - expect popover to not close
  3. Move selection using arrow keys up and down - works fine
  4. 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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions