Skip to content

Commit

Permalink
fix(textarea): remove space if prefix/suffix is hidden (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
SisIvanova authored Jan 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 0d87b68 commit df490fd
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/input/input-base.ts
Original file line number Diff line number Diff line change
@@ -52,10 +52,16 @@ export abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin(
@queryAssignedElements({ slot: 'helper-text' })
protected _helperText!: Array<HTMLElement>;

@queryAssignedElements({ slot: 'prefix' })
@queryAssignedElements({
slot: 'prefix',
selector: '[slot="prefix"]:not([hidden])',
})
protected prefixes!: Array<HTMLElement>;

@queryAssignedElements({ slot: 'suffix' })
@queryAssignedElements({
slot: 'suffix',
selector: '[slot="suffix"]:not([hidden])',
})
protected suffixes!: Array<HTMLElement>;

protected get _isMaterial() {
10 changes: 8 additions & 2 deletions src/components/textarea/textarea.ts
Original file line number Diff line number Diff line change
@@ -103,10 +103,16 @@ export default class IgcTextareaComponent extends FormAssociatedRequiredMixin(
@queryAssignedNodes({ flatten: true })
private projected!: Array<Node>;

@queryAssignedElements({ slot: 'prefix' })
@queryAssignedElements({
slot: 'prefix',
selector: '[slot="prefix"]:not([hidden])',
})
protected prefixes!: Array<HTMLElement>;

@queryAssignedElements({ slot: 'suffix' })
@queryAssignedElements({
slot: 'suffix',
selector: '[slot="suffix"]:not([hidden])',
})
protected suffixes!: Array<HTMLElement>;

@query('textarea', true)

0 comments on commit df490fd

Please sign in to comment.