diff --git a/common/changes/office-ui-fabric-react/law-textfieldMinSize_2018-02-21-21-44.json b/common/changes/office-ui-fabric-react/law-textfieldMinSize_2018-02-21-21-44.json new file mode 100644 index 00000000000000..962b8eae51e3d9 --- /dev/null +++ b/common/changes/office-ui-fabric-react/law-textfieldMinSize_2018-02-21-21-44.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "[TextField] Set input size to 1", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "law@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/TextField/TextField.scss b/packages/office-ui-fabric-react/src/components/TextField/TextField.scss index 6deccdf4964fd0..d802bb1ebd22ea 100644 --- a/packages/office-ui-fabric-react/src/components/TextField/TextField.scss +++ b/packages/office-ui-fabric-react/src/components/TextField/TextField.scss @@ -128,6 +128,12 @@ $field-error-color: $errorTextColor; color: $field-text-color; @include ms-padding(0, 12px, 0, 12px); width: 100%; + /** + * min-width is set to 1 in order to tell the browser to ignore the + * default value calculated from the size attribute and respect the + * width set on parent elements. + */ + min-width: 0; text-overflow: ellipsis; outline: 0; &:active, diff --git a/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx b/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx index 2c45908e76e6ba..2183281ec7a2dc 100644 --- a/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx +++ b/packages/office-ui-fabric-react/src/components/TextField/TextField.tsx @@ -294,7 +294,7 @@ export class TextField extends BaseComponent i const { label, componentId - } = props; + } = props; if (label) { return (); }