Skip to content

Commit

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

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

const onPanelClick = (event) => {
Expand Down Expand Up @@ -417,6 +416,20 @@ export const Dropdown = React.memo(React.forwardRef((props, ref) => {
}
});
}

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

Expand Down

0 comments on commit f23639b

Please sign in to comment.