Skip to content

Commit

Permalink
Merge pull request #998 from CruGlobal/reapply-autocomplete-focus-patch
Browse files Browse the repository at this point in the history
[no-Jira] Reapply the autocomplete focus patch to @mui/base
  • Loading branch information
canac authored Aug 14, 2024
2 parents bbc74f4 + bc03824 commit 103d35e
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 46 deletions.
48 changes: 24 additions & 24 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
diff --git a/AutocompleteUnstyled/useAutocomplete.js b/AutocompleteUnstyled/useAutocomplete.js
index 8bb17682cf79bf201ab080833d10194832e6080e..53357d7cbf8fc9a6eca319f68af9f0fc8854129b 100644
--- a/AutocompleteUnstyled/useAutocomplete.js
+++ b/AutocompleteUnstyled/useAutocomplete.js
@@ -344,6 +344,10 @@ export default function useAutocomplete(props) {
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;
}
@@ -1009,6 +1013,9 @@ export default function useAutocomplete(props) {
@@ -958,6 +961,9 @@ export function useAutocomplete(props) {
onMouseDown: event => {
// Prevent blur
event.preventDefault();
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@
"package-json/got": "^11.8.5",
"http-cache-semantics": "~4.1.1",
"cacheable-request": "^10.2.7",
"@mui/base@5.0.0-alpha.98": "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/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/base@5.0.0-beta.40": "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"
Expand Down
23 changes: 11 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4945,7 +4945,7 @@ __metadata:
languageName: node
linkType: hard

"@mui/base@npm:5.0.0-beta.40, @mui/base@npm:^5.0.0-beta.36":
"@mui/base@npm:5.0.0-beta.40":
version: 5.0.0-beta.40
resolution: "@mui/base@npm:5.0.0-beta.40"
dependencies:
Expand All @@ -4967,26 +4967,25 @@ __metadata:
languageName: node
linkType: hard

"@mui/base@patch:@mui/base@npm%3A5.0.0-alpha.98#./.yarn/patches/@mui-base-npm-5.0.0-alpha.98-f4d605d753.patch::locator=mpdx-react%40workspace%3A.":
version: 5.0.0-alpha.98
resolution: "@mui/base@patch:@mui/base@npm%3A5.0.0-alpha.98#./.yarn/patches/@mui-base-npm-5.0.0-alpha.98-f4d605d753.patch::version=5.0.0-alpha.98&hash=8e63fa&locator=mpdx-react%40workspace%3A."
"@mui/base@patch:@mui/base@npm%3A5.0.0-beta.40#./.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch::locator=mpdx-react%40workspace%3A.":
version: 5.0.0-beta.40
resolution: "@mui/base@patch:@mui/base@npm%3A5.0.0-beta.40#./.yarn/patches/@mui-base-npm-5.0.0-beta.40-248417914d.patch::version=5.0.0-beta.40&hash=6b20e2&locator=mpdx-react%40workspace%3A."
dependencies:
"@babel/runtime": ^7.19.0
"@emotion/is-prop-valid": ^1.2.0
"@mui/types": ^7.2.0
"@mui/utils": ^5.10.6
"@popperjs/core": ^2.11.6
clsx: ^1.2.1
"@babel/runtime": ^7.23.9
"@floating-ui/react-dom": ^2.0.8
"@mui/types": ^7.2.14
"@mui/utils": ^5.15.14
"@popperjs/core": ^2.11.8
clsx: ^2.1.0
prop-types: ^15.8.1
react-is: ^18.2.0
peerDependencies:
"@types/react": ^17.0.0 || ^18.0.0
react: ^17.0.0 || ^18.0.0
react-dom: ^17.0.0 || ^18.0.0
peerDependenciesMeta:
"@types/react":
optional: true
checksum: 728d6e97c6a54e99f670fe3fecd1ae2829986e14498f7a0060f995de3a8790eba19ccc97d0f819c7f788e2c271795e31ae1e8f71fb617d0e7261d87ec00b21b4
checksum: 4a14fd43a4b40787fb63562e3283c18e060249678c9605982b372b7675d0da3157056712fd8bd0a5fdaa28b8c22445c9d0292aab16e7912d0635b567417347eb
languageName: node
linkType: hard

Expand Down

0 comments on commit 103d35e

Please sign in to comment.