From df490fd4362a26dbee3c0338f5f6f0642f06e7cc Mon Sep 17 00:00:00 2001 From: Silvia Ivanova <59446295+SisIvanova@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:18:43 +0200 Subject: [PATCH] fix(textarea): remove space if prefix/suffix is hidden (#1526) --- src/components/input/input-base.ts | 10 ++++++++-- src/components/textarea/textarea.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/input/input-base.ts b/src/components/input/input-base.ts index 46685af4c..2a2461762 100644 --- a/src/components/input/input-base.ts +++ b/src/components/input/input-base.ts @@ -52,10 +52,16 @@ export abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin( @queryAssignedElements({ slot: 'helper-text' }) protected _helperText!: Array; - @queryAssignedElements({ slot: 'prefix' }) + @queryAssignedElements({ + slot: 'prefix', + selector: '[slot="prefix"]:not([hidden])', + }) protected prefixes!: Array; - @queryAssignedElements({ slot: 'suffix' }) + @queryAssignedElements({ + slot: 'suffix', + selector: '[slot="suffix"]:not([hidden])', + }) protected suffixes!: Array; protected get _isMaterial() { diff --git a/src/components/textarea/textarea.ts b/src/components/textarea/textarea.ts index 6684513f3..86175e616 100644 --- a/src/components/textarea/textarea.ts +++ b/src/components/textarea/textarea.ts @@ -103,10 +103,16 @@ export default class IgcTextareaComponent extends FormAssociatedRequiredMixin( @queryAssignedNodes({ flatten: true }) private projected!: Array; - @queryAssignedElements({ slot: 'prefix' }) + @queryAssignedElements({ + slot: 'prefix', + selector: '[slot="prefix"]:not([hidden])', + }) protected prefixes!: Array; - @queryAssignedElements({ slot: 'suffix' }) + @queryAssignedElements({ + slot: 'suffix', + selector: '[slot="suffix"]:not([hidden])', + }) protected suffixes!: Array; @query('textarea', true)