-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply the autocomplete focus patch to @mui/base
It was broken by the MUI upgrade in c4d5fa4
- Loading branch information
Showing
9 changed files
with
80 additions
and
141 deletions.
There are no files selected for viewing
Binary file removed
BIN
-16.6 KB
.yarn/cache/@emotion-is-prop-valid-npm-1.2.0-332d343e3d-cc7a19850a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/useAutocomplete/useAutocomplete.js b/useAutocomplete/useAutocomplete.js | ||
index b2c2a8a6770571390b3aa61267413314865642e7..8d386b2b0e240ae5746d156d3b8dea110a80bee2 100644 | ||
--- a/useAutocomplete/useAutocomplete.js | ||
+++ b/useAutocomplete/useAutocomplete.js | ||
@@ -330,6 +330,9 @@ export function useAutocomplete(props) { | ||
} | ||
const getNextIndex = () => { | ||
const maxIndex = filteredOptions.length - 1; | ||
+ if (diff === 'clear') { | ||
+ return -1; | ||
+ } | ||
if (diff === 'reset') { | ||
return defaultHighlighted; | ||
} | ||
@@ -958,6 +961,9 @@ export function useAutocomplete(props) { | ||
onMouseDown: event => { | ||
// Prevent blur | ||
event.preventDefault(); | ||
+ }, | ||
+ onMouseLeave: () => { | ||
+ changeHighlightedIndex({ diff: 'clear' }); | ||
} | ||
}), | ||
getOptionProps: ({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,8 +183,10 @@ | |
"package-json/got": "^11.8.5", | ||
"http-cache-semantics": "~4.1.1", | ||
"cacheable-request": "^10.2.7", | ||
"@mui/[email protected]": "patch:@mui/base@npm%3A5.0.0-alpha.98#./.yarn/patches/@mui-base-npm-5.0.0-alpha.98-f4d605d753.patch", | ||
"@mui/x-data-grid@^5.17.4": "patch:@mui/x-data-grid@npm%3A5.17.4#./.yarn/patches/@mui-x-data-grid-npm-5.17.4-542730a19e.patch" | ||
"@mui/[email protected]": "patch:@mui/base@npm%3A5.0.0-beta.40#./.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch", | ||
"@mui/x-data-grid@^5.17.4": "patch:@mui/x-data-grid@npm%3A5.17.4#./.yarn/patches/@mui-x-data-grid-npm-5.17.4-542730a19e.patch", | ||
"@mui/base@^5.0.0-beta.36": "patch:@mui/base@npm%3A5.0.0-beta.40#./.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch", | ||
"@mui/[email protected]": "patch:@mui/base@npm%3A5.0.0-beta.40#./.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,tsx}": "eslint --cache --fix" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters