mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [dropdown] add triggerKeys attribute (#19124)
* feat(components): [dropdown] add triggerKeys attribute Add a triggerKeys property to the dropdown to allow users to customize the triggerKeys, thereby addressing interaction issues when el-input is used as the trigger element. closed #19102 * Update docs/en-US/component/dropdown.md Co-authored-by: btea <2356281422@qq.com> * fix: rename triggerKeys to dropdownTriggerKeys * Update docs/en-US/component/dropdown.md Co-authored-by: qiang <qw13131wang@gmail.com> * Update packages/components/dropdown/src/dropdown.ts Co-authored-by: qiang <qw13131wang@gmail.com> * fix: remove redundant logic --------- Co-authored-by: btea <2356281422@qq.com> Co-authored-by: qiang <qw13131wang@gmail.com>
This commit is contained in:
@@ -92,7 +92,7 @@ dropdown/sizes
|
||||
### Dropdown Attributes
|
||||
|
||||
| Name | Description | Type | Default |
|
||||
| -------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
||||
| -------------------- |-----------------------------------------------------------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
||||
| type | menu button type, refer to `Button` Component, only works when `split-button` is true | ^[enum]`'' \| 'default' \| 'primary' \| 'success' \| 'warning' \| 'info' \| 'danger' \| 'text' (deprecated)` | '' |
|
||||
| size | menu size, also works on the split button | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | '' |
|
||||
| max-height | the max height of menu | ^[string] / ^[number] | '' |
|
||||
@@ -100,6 +100,7 @@ dropdown/sizes
|
||||
| disabled | whether to disable | ^[boolean] | false |
|
||||
| placement | placement of pop menu | ^[enum]`'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end'` | bottom |
|
||||
| trigger | how to trigger | ^[enum]`'hover' \| 'click' \| 'contextmenu'` | hover |
|
||||
| triggerKeys ^(2.9.1) | specify whick keys on the keyboard can trigger when pressed | ^[array]`string[]` | `['Enter', 'Space', 'ArrowDown', 'NumpadEnter']`
|
||||
| hide-on-click | whether to hide menu after clicking menu-item | ^[boolean] | true |
|
||||
| show-timeout | delay time before show a dropdown (only works when trigger is `hover`) | ^[number] | 150 |
|
||||
| hide-timeout | delay time before hide a dropdown (only works when trigger is `hover`) | ^[number] | 150 |
|
||||
|
||||
Reference in New Issue
Block a user