Skip to content

Commit c246fac

Browse files
GabriellDatacampdatacampsismellowareGabriellReis14
authored
Fix #6058 Dropdown: Select value with Enter when optionValue is set (#6703)
* Fix: Remove setTokens in onPaste on InputOtp to avoid duplicate values - When pasted the value into InputOtp, was duplicating the value, as the state was updated in onPaste and onInput * Update InputOtp.js * Fix #6058 Dropdown: Select value with Enter when optionValue is set --------- Co-authored-by: Datacamp <[email protected]> Co-authored-by: Melloware <[email protected]> Co-authored-by: Gabriell Reis Alvarenga <[email protected]>
1 parent 5feb844 commit c246fac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

components/lib/dropdown/Dropdown.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,9 @@ export const Dropdown = React.memo(
170170
};
171171

172172
const onOptionSelect = (event, option, isHide = true) => {
173-
const value = getOptionValue(option);
174-
175173
selectItem({
176174
originalEvent: event,
177-
option: value
175+
option
178176
});
179177

180178
isHide && hide(true);
@@ -754,6 +752,7 @@ export const Dropdown = React.memo(
754752
updateEditableLabel(event.option);
755753
setFocusedOptionIndex(-1);
756754
const optionValue = getOptionValue(event.option);
755+
757756
const selectedOptionIndex = findOptionIndexInList(event.option, visibleOptions);
758757

759758
if (props.onChange) {

0 commit comments

Comments
 (0)