mui / mui/material-ui

[material-ui][Chip] Disable blur() event on escape key should be opt-in

Open
#41,470 1 comment 1 reaction 1 assignee View on GitHub

@DiegoAndai is already working on this.

Since Mar 13, 2024.

scope: chip type: new feature waiting for 👍
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @mui/material@5.15.12 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@mui/material/Chip/Chip.js b/node_modules/@mui/material/Chip/Chip.js
index 5f9d12e..f0110dd 100644
--- a/node_modules/@mui/material/Chip/Chip.js
+++ b/node_modules/@mui/material/Chip/Chip.js
@@ -330,7 +330,7 @@ const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
       if (onDelete && isDeleteKeyboardEvent(event)) {
         onDelete(event);
       } else if (event.key === 'Escape' && chipRef.current) {
-        chipRef.current.blur();
+        // Commented out by httpete with patch-package chipRef.current.blur();
       }
     }
     if (onKeyUp) {

This issue body was partially generated by patch-package.

Search keywords:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.