Skip to content

Commit

Permalink
Fix #2224: Dropdown correct onBlur event (#3164)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Aug 18, 2022
1 parent 32d3b49 commit e18f15e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion components/lib/dropdown/Dropdown.js
Expand Up @@ -82,7 +82,22 @@ export const Dropdown = React.memo(React.forwardRef((props, ref) => {

const onInputBlur = (event) => {
setFocusedState(false);
props.onBlur && props.onBlur(event);

if (props.onBlur) {
setTimeout(() => {
props.onBlur({
originalEvent: event.originalEvent,
value: inputRef.current.value,
stopPropagation: () => { },
preventDefault: () => { },
target: {
name: props.name,
id: props.id,
value: inputRef.current.value,
}
});
}, 200);
}
}

const onPanelClick = (event) => {
Expand Down

0 comments on commit e18f15e

Please sign in to comment.