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)