Skip to content

Commit

Permalink
Fix/dropdown select 1845 (#1913)
Browse files Browse the repository at this point in the history
* refactor: adding fix
  • Loading branch information
marvinLaubenstein authored Jun 23, 2023
1 parent a315313 commit 2ac358b
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ export class DropdownSelect {
readOptions(this.hostElement).find(({ value }) => value === this.value) ||
({} as any)
).ItemElement;
const hasEmptyValueElement =
(
readOptions(this.hostElement).find(
({ value }) => value === this.value
) || ({} as any)
).value === ''
? true
: false;
const helperTextId = `helper-message-${generateUniqueId()}`;
const ariaDescribedByAttr = { 'aria-describedBy': helperTextId };

Expand Down Expand Up @@ -434,7 +442,9 @@ export class DropdownSelect {
{...(this.helperText ? ariaDescribedByAttr : {})}
{...(this.invalid ? { 'aria-invalid': 'true' } : {})}
>
<span part="combobox-value">{ValueElement}</span>
<span part="combobox-value">
{hasEmptyValueElement ? '' : ValueElement}
</span>
</div>
<div part="listbox-pad" ref={(el) => (this.listboxPadEl = el)}>
<div part="listbox-scroll-container">
Expand Down

0 comments on commit 2ac358b

Please sign in to comment.