Skip to content

Commit

Permalink
Merge pull request #6323 from gucal/issue-6274
Browse files Browse the repository at this point in the history
#6274 - InputText: It doesnt take classNames when unstyled is true
  • Loading branch information
gucal authored Apr 8, 2024
2 parents 1e7a386 + e1b9667 commit 860dff3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/lib/inputtext/InputText.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useHandleStyle } from '../componentbase/ComponentBase';
import { useMergeProps } from '../hooks/Hooks';
import { KeyFilter } from '../keyfilter/KeyFilter';
import { Tooltip } from '../tooltip/Tooltip';
import { DomHandler, ObjectUtils } from '../utils/Utils';
import { DomHandler, ObjectUtils, classNames } from '../utils/Utils';
import { InputTextBase } from './InputTextBase';

export const InputText = React.memo(
Expand Down Expand Up @@ -71,7 +71,7 @@ export const InputText = React.memo(

const rootProps = mergeProps(
{
className: cx('root', { context, isFilled }),
className: classNames(props.className, cx('root', { context, isFilled })),
onBeforeInput: onBeforeInput,
onInput: onInput,
onKeyDown: onKeyDown,
Expand Down
17 changes: 6 additions & 11 deletions components/lib/inputtext/InputTextBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ import { classNames } from '../utils/Utils';

const classes = {
root: ({ props, isFilled, context }) =>
classNames(
'p-inputtext p-component',
{
'p-disabled': props.disabled,
'p-filled': isFilled,
'p-invalid': props.invalid,
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
},

props.className
)
classNames('p-inputtext p-component', {
'p-disabled': props.disabled,
'p-filled': isFilled,
'p-invalid': props.invalid,
'p-variant-filled': props.variant ? props.variant === 'filled' : context && context.inputStyle === 'filled'
})
};

export const InputTextBase = ComponentBase.extend({
Expand Down

0 comments on commit 860dff3

Please sign in to comment.