diff --git a/components/lib/inputtext/InputText.js b/components/lib/inputtext/InputText.js index 9349b4687a..596758f495 100644 --- a/components/lib/inputtext/InputText.js +++ b/components/lib/inputtext/InputText.js @@ -36,9 +36,10 @@ export const InputText = React.memo(React.forwardRef((props, ref) => { } } + const currentValue = elementRef.current && elementRef.current.value; const isFilled = React.useMemo(() => ( - ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || (elementRef.current && ObjectUtils.isNotEmpty(elementRef.current.value)) - ), [props.value, props.defaultValue]); + ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue) + ), [props.value, props.defaultValue, currentValue]); React.useEffect(() => { ObjectUtils.combinedRefs(elementRef, ref); diff --git a/components/lib/inputtextarea/InputTextarea.js b/components/lib/inputtextarea/InputTextarea.js index d5fe0e5ceb..4c6240c02b 100644 --- a/components/lib/inputtextarea/InputTextarea.js +++ b/components/lib/inputtextarea/InputTextarea.js @@ -67,9 +67,10 @@ export const InputTextarea = React.memo(React.forwardRef((props, ref) => { } } + const currentValue = elementRef.current && elementRef.current.value; const isFilled = React.useMemo(() => ( - ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || (elementRef.current && ObjectUtils.isNotEmpty(elementRef.current.value)) - ), [props.value, props.defaultValue]); + ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue) + ), [props.value, props.defaultValue, currentValue]); React.useEffect(() => { ObjectUtils.combinedRefs(elementRef, ref); diff --git a/components/lib/mention/Mention.js b/components/lib/mention/Mention.js index bcd7323cb0..1a7a2a5fc4 100644 --- a/components/lib/mention/Mention.js +++ b/components/lib/mention/Mention.js @@ -308,9 +308,10 @@ export const Mention = React.memo(React.forwardRef((props, ref) => { } } + const currentValue = inputRef.current && inputRef.current.value; const isFilled = React.useMemo(() => ( - ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || (inputRef.current && ObjectUtils.isNotEmpty(inputRef.current.value)) - ), [props.value, props.defaultValue, inputRef]); + ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue) + ), [props.value, props.defaultValue, currentValue]); React.useImperativeHandle(ref, () => ({ props, diff --git a/components/lib/password/Password.js b/components/lib/password/Password.js index 342baa5fc5..32aafcecba 100644 --- a/components/lib/password/Password.js +++ b/components/lib/password/Password.js @@ -31,9 +31,10 @@ export const Password = React.memo(React.forwardRef((props, ref) => { }, when: overlayVisibleState }); + const currentValue = inputRef.current && inputRef.current.value; const isFilled = React.useMemo(() => ( - ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || (inputRef.current && ObjectUtils.isNotEmpty(inputRef.current.value)) - ), [props.value, props.defaultValue, inputRef]); + ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue) || ObjectUtils.isNotEmpty(currentValue) + ), [props.value, props.defaultValue, currentValue]); const updateLabels = () => { if (meterState) {