diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 3924be71..ea222df9 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4048,7 +4048,7 @@ None. | ref | No | let | Yes | null | HTMLTextAreaElement | null | Obtain a reference to the textarea HTML element | | value | No | let | Yes | string | "" | Specify the textarea value | | placeholder | No | let | No | string | "" | Specify the placeholder text | -| cols | No | let | No | number | 50 | Specify the number of cols | +| cols | No | let | No | number | undefined | Specify the number of cols | | rows | No | let | No | number | 4 | Specify the number of rows | | maxCount | No | let | No | number | undefined | Specify the max character count | | light | No | let | No | boolean | false | Set to `true` to enable the light variant | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 39241a60..163823f2 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -12454,7 +12454,6 @@ "kind": "let", "description": "Specify the number of cols", "type": "number", - "value": "50", "isFunction": false, "isFunctionDeclaration": false, "isRequired": false, diff --git a/src/TextArea/TextArea.svelte b/src/TextArea/TextArea.svelte index 0e395931..bd11d718 100644 --- a/src/TextArea/TextArea.svelte +++ b/src/TextArea/TextArea.svelte @@ -5,8 +5,11 @@ /** Specify the placeholder text */ export let placeholder = ""; - /** Specify the number of cols */ - export let cols = 50; + /** + * Specify the number of cols + * @type {number} + * */ + export let cols = undefined; /** Specify the number of rows */ export let rows = 4; @@ -110,6 +113,7 @@ class:bx--text-area--light="{light}" class:bx--text-area--invalid="{invalid}" maxlength="{maxCount ?? undefined}" + style="{cols ? '' : 'width: 100%;'}" {...$$restProps} on:change on:input diff --git a/types/TextArea/TextArea.svelte.d.ts b/types/TextArea/TextArea.svelte.d.ts index 6b1fa440..acb07907 100644 --- a/types/TextArea/TextArea.svelte.d.ts +++ b/types/TextArea/TextArea.svelte.d.ts @@ -18,7 +18,7 @@ export interface TextAreaProps extends RestProps { /** * Specify the number of cols - * @default 50 + * @default undefined */ cols?: number;