From 8ff8007f32ebed332a1427b579a2acd589c6e8b8 Mon Sep 17 00:00:00 2001 From: Gregor Wassmann Date: Fri, 31 Mar 2023 19:45:57 +0200 Subject: [PATCH] chore: v11 TextArea `cols` no longer has a defaults to 50 but remains at 100% width by default. --- COMPONENT_INDEX.md | 2 +- docs/src/COMPONENT_API.json | 1 - src/TextArea/TextArea.svelte | 8 ++++++-- types/TextArea/TextArea.svelte.d.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 6171d213..13c96931 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4044,7 +4044,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 c36d1ac7..3c519dcc 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -12408,7 +12408,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;