Skip to content

Commit

Permalink
Fix #7354: InputMask Classname p-filled not works fine (#7355)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpajon authored Oct 18, 2024
1 parent a9497e6 commit 871a3a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/lib/inputmask/InputMask.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ export const InputMask = React.memo(
name={props.name}
style={props.style}
className={className}
value={props.value}
{...otherProps}
placeholder={props.placeholder}
size={props.size}
Expand Down
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 871a3a3

Please sign in to comment.