mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
feat(components): [select] add aria-label to select's input (#13932)
* feat(components): [select] add aria-label to select's input Select's input causes accessibility issues without aria-label, this commit adds it * refactor(components): [select] change aria-label to label; update docs * refactor(components): [select] change back to ariaLabel prop name * docs(components): kebab-case for docs
This commit is contained in:
parent
268457135e
commit
c29f6cc6c7
@ -163,6 +163,7 @@ select/value-key
|
||||
| placement ^(2.2.17) | position of dropdown | ^[enum]`'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | bottom-start |
|
||||
| max-collapse-tags ^(2.3.0) | the max tags number to be shown. To use this, `collapse-tags` must be true | ^[number] | 1 |
|
||||
| popper-options | [popper.js](https://popper.js.org/docs/v2/) parameters | ^[object]refer to [popper.js](https://popper.js.org/docs/v2/) doc | {} |
|
||||
| aria-label ^(a11y) | same as `aria-label` in native input | ^[string] | — |
|
||||
|
||||
:::warning
|
||||
|
||||
|
@ -149,6 +149,7 @@
|
||||
:disabled="selectDisabled"
|
||||
:autocomplete="autocomplete"
|
||||
:style="inputStyle"
|
||||
:aria-label="ariaLabel"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@keyup="managePlaceholder"
|
||||
@ -191,6 +192,7 @@
|
||||
:validate-event="false"
|
||||
:class="[nsSelect.is('focus', visible)]"
|
||||
:tabindex="multiple && filterable ? -1 : undefined"
|
||||
:label="ariaLabel"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@input="debouncedOnInputChange"
|
||||
@ -526,6 +528,13 @@ export default defineComponent({
|
||||
values: placements,
|
||||
default: 'bottom-start',
|
||||
},
|
||||
/**
|
||||
* @description native input aria-label
|
||||
*/
|
||||
ariaLabel: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
UPDATE_MODEL_EVENT,
|
||||
|
Loading…
Reference in New Issue
Block a user