mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
feat(Dropdown): add clear input key binding (#4002)
This commit is contained in:
parent
7529764482
commit
dd74bcd821
2 changed files with 17 additions and 0 deletions
|
@ -339,6 +339,9 @@ export default {
|
|||
this.onArrowLeftKey(event, this.editable);
|
||||
break;
|
||||
|
||||
case 'Delete':
|
||||
this.onDeleteKey(event);
|
||||
|
||||
case 'Home':
|
||||
this.onHomeKey(event, this.editable);
|
||||
break;
|
||||
|
@ -507,6 +510,12 @@ export default {
|
|||
break;
|
||||
}
|
||||
},
|
||||
onDeleteKey(event) {
|
||||
if (this.showClear) {
|
||||
this.updateModel(event, null);
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
onArrowDownKey(event) {
|
||||
const optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue