Skip to content

Commit

Permalink
fix(MultiSelect): fix phantom selection on MenuKeyDownEnter
Browse files Browse the repository at this point in the history
  • Loading branch information
dakahn committed Sep 29, 2021
1 parent 58006cc commit a37cd32
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 12 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@carbon/telemetry": "0.0.0-alpha.6",
"classnames": "2.3.1",
"copy-to-clipboard": "^3.3.1",
"downshift": "5.2.1",
"downshift": "6.1.7",
"flatpickr": "4.6.9",
"invariant": "^2.2.3",
"lodash.debounce": "^4.0.8",
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/components/MultiSelect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ const MultiSelect = React.forwardRef(function MultiSelect(
case ItemClick:
case MenuKeyDownSpaceButton:
case MenuKeyDownEnter:
if (changes.selectedItem === undefined) {
break;
}
onItemChange(changes.selectedItem);
break;
case MenuKeyDownArrowDown:
Expand Down
39 changes: 28 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.13.17, @babel/runtime@npm:^7.13.8, @babel/runtime@npm:^7.14.6, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.4, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.1, @babel/runtime@npm:^7.9.2":
"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.13.17, @babel/runtime@npm:^7.13.8, @babel/runtime@npm:^7.14.6, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.4, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2":
version: 7.14.6
resolution: "@babel/runtime@npm:7.14.6"
dependencies:
Expand All @@ -1629,6 +1629,15 @@ __metadata:
languageName: node
linkType: hard

"@babel/runtime@npm:^7.14.8":
version: 7.15.4
resolution: "@babel/runtime@npm:7.15.4"
dependencies:
regenerator-runtime: ^0.13.4
checksum: c40825430400e47c19b97e4142d5315d2910305b9714d44a711472587ee2fd4521fdba5f02ddd9df3902f5e988d9854fa83f4da1e0c091f70f6983fa52480606
languageName: node
linkType: hard

"@babel/template@npm:^7.12.7, @babel/template@npm:^7.14.5, @babel/template@npm:^7.3.3":
version: 7.14.5
resolution: "@babel/template@npm:7.14.5"
Expand Down Expand Up @@ -10347,7 +10356,7 @@ __metadata:
css-loader: ^3.4.2
cypress: ^8.1.0
cypress-real-events: ^1.5.1
downshift: 5.2.1
downshift: 6.1.7
fast-sass-loader: ^1.5.0
flatpickr: 4.6.9
gzip-size: ^6.0.0
Expand Down Expand Up @@ -11678,7 +11687,7 @@ __metadata:
languageName: node
linkType: hard

"compute-scroll-into-view@npm:^1.0.13, compute-scroll-into-view@npm:^1.0.17":
"compute-scroll-into-view@npm:^1.0.17":
version: 1.0.17
resolution: "compute-scroll-into-view@npm:1.0.17"
checksum: b20c05a10c37813c5a6e4bf053c00f65c88d23afed7a6bd7a2a69e05e2ffc2df3483ecfe407d36bf16b8cec8be21ae1966c9c523093a03117e567156cd79a51e
Expand Down Expand Up @@ -13690,17 +13699,18 @@ __metadata:
languageName: node
linkType: hard

"downshift@npm:5.2.1":
version: 5.2.1
resolution: "downshift@npm:5.2.1"
"downshift@npm:6.1.7":
version: 6.1.7
resolution: "downshift@npm:6.1.7"
dependencies:
"@babel/runtime": ^7.9.1
compute-scroll-into-view: ^1.0.13
"@babel/runtime": ^7.14.8
compute-scroll-into-view: ^1.0.17
prop-types: ^15.7.2
react-is: ^16.13.1
react-is: ^17.0.2
tslib: ^2.3.0
peerDependencies:
react: ">=0.14.9"
checksum: fc8e731106cdaa9bfcd1d855d8b25dbaaa6fb22dfb51a3c32e51f460c199730a6ddfbd311891bbdc4bba642238d2239f1fb7642ce5d3f616f09fc68abd6a76f4
react: ">=16.12.0"
checksum: 0904ed8f285d31ee00e471dcddd57e72468bee354b191167bcaebe690ec292647fe4c31f483665094d750e72dd71e5d7db695acef33ab5dba6a39fed0112bab6
languageName: node
linkType: hard

Expand Down Expand Up @@ -33191,6 +33201,13 @@ resolve@^2.0.0-next.3:
languageName: node
linkType: hard

"tslib@npm:^2.3.0":
version: 2.3.1
resolution: "tslib@npm:2.3.1"
checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9
languageName: node
linkType: hard

"tsutils@npm:^3.21.0":
version: 3.21.0
resolution: "tsutils@npm:3.21.0"
Expand Down

0 comments on commit a37cd32

Please sign in to comment.