Skip to content

Commit

Permalink
fix(select): presence of placeholder in ax tree
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Apr 11, 2024
1 parent 7301428 commit 74179fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion elements/pf-select/pf-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class PfOption extends LitElement {
/** form value for this option */
@property({ reflect: true })
get value() {
return this.#value ?? this.textContent ?? '';
return (this.#value ?? this.textContent ?? '').trim();
}

set value(v: string) {
Expand Down
2 changes: 1 addition & 1 deletion elements/pf-select/pf-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class PfSelect extends LitElement {
class="${classMap({ checkboxes })}">
<pf-option id="placeholder"
disabled
aria-hidden="${String(hasSelection) as 'true' | 'false'}"
aria-hidden="${ifDefined(hasSelection ? 'true' : undefined)}"
?hidden="${!this.placeholder && !this.#slots.hasSlotted('placeholder')}">
<slot name="placeholder">${this.placeholder}</slot>
</pf-option>
Expand Down

0 comments on commit 74179fd

Please sign in to comment.