Skip to content

Commit

Permalink
Fix: ensure controls for text-field and text-area span the full width…
Browse files Browse the repository at this point in the history
… of host (microsoft#14492)

Co-authored-by: Seth Donohue <sethdonohue@Admins-MBP.guest.corp.microsoft.com>
  • Loading branch information
2 people authored and levithomason committed Aug 24, 2020
1 parent 4012a18 commit b266ae0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "patch",
"comment": "fix: add full width to text-area and text-field controls to expand properly with component",
"packageName": "@fluentui/web-components",
"email": "sethdonohue@Admins-MBP.guest.corp.microsoft.com",
"dependentChangeType": "patch",
"date": "2020-08-12T18:41:04.074Z"
}
3 changes: 3 additions & 0 deletions packages/web-components/src/text-area/fixtures/text-area.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ <h4>Default</h4>
<span>label</span>
</fluent-text-area>

<h4>Full Width</h4>
<fluent-text-area style="width: 100%;"></fluent-text-area>

<h4>Placeholder</h4>
<fluent-text-area placeholder="Placeholder"></fluent-text-area>

Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/src/text-area/text-area.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FluentTextArea;
FluentDesignSystemProvider;

export default {
title: 'Text area',
title: 'Text Area',
};

export const TextArea = (): string => Examples;
2 changes: 1 addition & 1 deletion packages/web-components/src/text-area/text-area.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const TextAreaStyles = css`
font-size: var(--type-ramp-base-font-size);
line-height: var(--type-ramp-base-line-height);
padding: calc(var(--design-unit) * 1.5px) calc(var(--design-unit) * 2px + 1px);
max-width: 100%;
width: 100%;
resize: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ <h4>Default</h4>
<fluent-text-field></fluent-text-field>
<fluent-text-field>Label</fluent-text-field>

<h4>Full Width</h4>
<fluent-text-field style="width: 100%;"></fluent-text-field>

<h4>Placeholder</h4>
<fluent-text-field placeholder="Placeholder"></fluent-text-field>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const TextFieldStyles = css`
background: transparent;
border: 0;
height: calc(100% - 4px);
width: 100%;
margin-top: auto;
margin-bottom: auto;
border: none;
Expand Down

0 comments on commit b266ae0

Please sign in to comment.