Skip to content

Commit

Permalink
fix(select): fix keyboard select wrong target value issue
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbien committed Apr 9, 2020
1 parent afc79de commit db8ff1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,13 @@ const Select = React.forwardRef(function Select(props, ref) {
handleClose(e);
displayNode.current.focus();
if (onChange) {
const option = options[currentFocusIndex];
e.persist();
onChange(e, options[currentFocusIndex]);
Object.defineProperty(e, 'target', {
writable: true,
value: { value: option.value, name }
});
onChange(e, option);
}
}
}
Expand Down

0 comments on commit db8ff1c

Please sign in to comment.