vault/ui/lib/core/addon/components/select.hbs
Vault Automation 93aa30f3b6
[UI] Remove Template Lint A11y Overrides (#12236) (#12276)
* removes require-input-label ember-template-lint override

* adds aria-label to textarea in MaskedInput component

* more a11y fixes for missing labels

* adds aria-label back to lookup-input

* adds aria-label back to select component

* ensures aria-label has value in select component

* removes duplicate onchange handler from lookup-input component

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2026-02-10 10:22:23 -07:00

35 lines
No EOL
993 B
Handlebars

{{!
Copyright IBM Corp. 2016, 2025
SPDX-License-Identifier: BUSL-1.1
}}
{{#if this.label}}
<label for="select-{{this.name}}" class="is-label" data-test-select-label>
{{this.label}}
</label>
{{/if}}
<div class="control {{if this.isInline 'select is-inline-block'}}">
<div class="select {{if this.isFullwidth 'is-fullwidth'}}">
<select
class="select"
onchange={{action this.onChange value="target.value"}}
data-test-select={{this.name}}
aria-label={{or this.ariaLabel this.name}}
>
{{#if this.noDefault}}
<option value="">
Select one
</option>
{{/if}}
{{#each this.options as |op|}}
<option
disabled={{or op.isDisabled false}}
value={{or (get op this.valueAttribute) op}}
selected={{eq this.selectedValue (or (get op this.valueAttribute) op)}}
>
{{or (get op this.labelAttribute) op}}
</option>
{{/each}}
</select>
</div>
</div>