Skip to content

Commit

Permalink
Fix primefaces#1866: InputNumber arrows keys don't work tabbing into …
Browse files Browse the repository at this point in the history
…symbol field
  • Loading branch information
melloware committed Nov 11, 2022
1 parent 52131cf commit e50cf1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,13 @@ export const InputNumber = React.memo(
const onInputFocus = (event) => {
setFocusedState(true);
props.onFocus && props.onFocus(event);

if ((props.suffix || props.currency || props.prefix) && inputRef.current) {
// GitHub #1866 Cursor must be placed before/after symbol or arrow keys don't work
const selectionEnd = initCursor();

inputRef.current.setSelectionRange(selectionEnd, selectionEnd);
}
};

const onInputBlur = (event) => {
Expand Down

0 comments on commit e50cf1b

Please sign in to comment.