Skip to content

Commit

Permalink
Fixed primefaces#3072 - Chips: UX issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jul 18, 2022
1 parent 208afd3 commit 215e1c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/lib/chips/Chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ export const Chips = React.memo(React.forwardRef((props, ref) => {
}

const onBlur = (event) => {
const inputValue = event.target.value;
const values = props.value || [];

if (inputValue && inputValue.trim().length && (!props.max || props.max > values.length)) {
addItem(event, inputValue, true);
}
setFocusedState(false);
props.onBlur && props.onBlur(event);
}
Expand Down

0 comments on commit 215e1c9

Please sign in to comment.