diff --git a/packages/ra-ui-materialui/src/input/ResettableTextField.js b/packages/ra-ui-materialui/src/input/ResettableTextField.js index 3dabc5730af..52480815605 100644 --- a/packages/ra-ui-materialui/src/input/ResettableTextField.js +++ b/packages/ra-ui-materialui/src/input/ResettableTextField.js @@ -25,6 +25,10 @@ const useStyles = makeStyles({ }, }); +const handleMouseDownClearButton = event => { + event.preventDefault(); +}; + /** * An override of the default Material-UI TextField which is resettable */ @@ -52,10 +56,6 @@ function ResettableTextField({ [onChange] ); - const handleMouseDownClearButton = useCallback(event => { - event.preventDefault(); - }, []); - const handleFocus = useCallback( event => { setShowClear(true);