Skip to content

Commit

Permalink
fix: Handle p-filled when value and disabled change
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpajon committed Oct 17, 2024
1 parent 77274f1 commit 47e32cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/lib/inputtext/InputText.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ export const InputText = React.memo(
const isFilled = React.useMemo(() => ObjectUtils.isNotEmpty(props.value) || ObjectUtils.isNotEmpty(props.defaultValue), [props.value, props.defaultValue]);
const hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);

React.useEffect(() => {
if (isFilled) {
DomHandler.addClass(elementRef.current, 'p-filled');
} else {
DomHandler.removeClass(elementRef.current, 'p-filled');
}
}, [props.disabled, isFilled]);

const rootProps = mergeProps(
{
className: classNames(props.className, cx('root', { context, isFilled })),
Expand Down

0 comments on commit 47e32cd

Please sign in to comment.