Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "TextField: Fix application of inputClassName lost when component was converted to JS styling.",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class TextFieldBase extends BaseComponent<ITextFieldProps, ITextFieldStat
disabled,
iconClass,
iconProps,
inputClassName,
label,
multiline,
required,
Expand Down Expand Up @@ -195,7 +196,8 @@ export class TextFieldBase extends BaseComponent<ITextFieldProps, ITextFieldStat
resizable,
hasIcon: !!iconProps,
underlined,
iconClass
iconClass,
inputClassName
});

// If a custom description render function is supplied then treat description as always available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export function getStyles(props: ITextFieldStyleProps): ITextFieldStyles {
hasIcon,
resizable,
hasErrorMessage,
iconClass
iconClass,
inputClassName
} = props;

const { semanticColors, palette } = theme;
Expand Down Expand Up @@ -329,7 +330,8 @@ export function getStyles(props: ITextFieldStyleProps): ITextFieldStyles {
padding: '0 11px 0 11px'
}
}
}
},
inputClassName
],
icon: [
multiline && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ describe('TextField', () => {
}

it('renders TextField correctly', () => {
const component = renderer.create(<TextField label="Label" />);
const className = 'testClassName';
const inputClassName = 'testInputClassName';
const component = renderer.create(
<TextField label="Label" className={className} inputClassName={inputClassName} />
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,15 @@ export interface ITextFieldProps extends React.AllHTMLAttributes<HTMLInputElemen
export type ITextFieldStyleProps = Required<Pick<ITextFieldProps, 'theme'>> &
Pick<
ITextFieldProps,
'className' | 'disabled' | 'required' | 'multiline' | 'borderless' | 'resizable' | 'underlined' | 'iconClass'
| 'className'
| 'disabled'
| 'inputClassName'
| 'required'
| 'multiline'
| 'borderless'
| 'resizable'
| 'underlined'
| 'iconClass'
> & {
/** Element has an error message. */
hasErrorMessage?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`TextField renders TextField correctly 1`] = `
<div
className=
ms-TextField
testClassName
{
box-shadow: none;
box-sizing: border-box;
Expand Down Expand Up @@ -96,6 +97,7 @@ exports[`TextField renders TextField correctly 1`] = `
aria-label={undefined}
className=
ms-TextField-field
testInputClassName
{
background-color: transparent;
background: none;
Expand Down