Skip to content

[modal][select] Using keyboard Esc while Modal's Select is open should not close the Modal #327

@rh-meowsa

Description

@rh-meowsa

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/fervent-wiles-4htkjx?file=%2Fsrc%2FDemo.tsx%3A13%2C57
Steps:

  1. Create a modal and add a Select field inside it
  2. Open modal
  3. Open the Select dropdown
  4. Press Esc on the keyboard

Current behavior

Exits the Modal

Expected behavior

Exits only the Select (just like mui-material)

Context

Creating a form inside a modal for user to fill out and submit.

Your environment

npx @mui/envinfo

System:
OS: macOS 14.4.1
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: 8.6.11 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 123.0.6312.124
Edge: Not Found
Safari: 17.4.1
npmPackages:
@mui/base: 5.0.0-beta.37 => 5.0.0-beta.37
@types/react: 18.2.42 => 18.2.42
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0

using Chrome 123.0.6312.124

Search keywords: modal, select, escape, keyboard

Search keywords:

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: selectChanges related to the select component.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions