diff --git a/components/lib/inputtext/InputText.js b/components/lib/inputtext/InputText.js
index f571759ba6..2456ca7dd3 100644
--- a/components/lib/inputtext/InputText.js
+++ b/components/lib/inputtext/InputText.js
@@ -3,7 +3,7 @@ import { PrimeReactContext } from '../api/Api';
import { useHandleStyle } from '../componentbase/ComponentBase';
import { KeyFilter } from '../keyfilter/KeyFilter';
import { Tooltip } from '../tooltip/Tooltip';
-import { DomHandler, ObjectUtils, mergeProps } from '../utils/Utils';
+import { DomHandler, ObjectUtils, classNames, mergeProps } from '../utils/Utils';
import { InputTextBase } from './InputTextBase';
export const InputText = React.memo(
@@ -69,7 +69,7 @@ export const InputText = React.memo(
const rootProps = mergeProps(
{
- className: cx('root', { isFilled }),
+ className: classNames(props.className, cx('root', { isFilled })),
onBeforeInput: onBeforeInput,
onInput: onInput,
onKeyDown: onKeyDown,
diff --git a/components/lib/inputtext/InputText.spec.js b/components/lib/inputtext/InputText.spec.js
index 2ca9ef6006..033d609c5c 100644
--- a/components/lib/inputtext/InputText.spec.js
+++ b/components/lib/inputtext/InputText.spec.js
@@ -31,6 +31,18 @@ describe('InputText', () => {
expect(input).toHaveValue('');
expect(container).toMatchSnapshot();
});
+ test('when input has className only 1 className is printed', () => {
+ // Arrange
+ const { container } = render(