disable clear button if field is readonly

This commit is contained in:
Riccardo Balbo 2024-10-24 16:26:22 +02:00
parent 9c6e98b47b
commit 68dafa3684
1 changed files with 2 additions and 2 deletions

View File

@ -526,8 +526,8 @@ function InputInner ({
const [showClearButton, setShowClearButton] = useState(clear)
useEffect(() => {
setShowClearButton(clear && field.value)
}, [field.value])
setShowClearButton(clear && field.value && !props.readOnly)
}, [field.value, props.readOnly])
return (
<>