Skip to content

Commit

Permalink
Revert "ensures focus of input when InputControl spinner arrows are p…
Browse files Browse the repository at this point in the history
…ressed (#25753)"

This reverts commit 4e7c772.
  • Loading branch information
Jon Q committed Oct 7, 2020
1 parent bd79ac4 commit ab36a81
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/components/src/input-control/input-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function InputField(
setIsFocused,
stateReducer = ( state ) => state,
value: valueProp,
type,
...props
},
ref
Expand Down Expand Up @@ -102,19 +101,6 @@ function InputField(
}
};

/*
* Works around the odd UA (e.g. Firefox) that does not focus inputs of
* type=number when their spinner arrows are pressed.
*/
let handleOnMouseDown;
if ( type === 'number' ) {
handleOnMouseDown = ( event ) => {
if ( event.target !== event.target.ownerDocument.activeElement ) {
event.target.focus();
}
};
}

const handleOnFocus = ( event ) => {
onFocus( event );
setIsFocused( true );
Expand Down Expand Up @@ -205,11 +191,9 @@ function InputField(
onChange={ handleOnChange }
onFocus={ handleOnFocus }
onKeyDown={ handleOnKeyDown }
onMouseDown={ handleOnMouseDown }
ref={ ref }
size={ size }
value={ value }
type={ type }
/>
);
}
Expand Down

0 comments on commit ab36a81

Please sign in to comment.