mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
UX: allows to navigate widget dropdown with tab and enter (#10356)
This commit is contained in:
parent
12913a46e4
commit
eb61916e23
@ -114,7 +114,10 @@ export const WidgetDropdownItemClass = {
|
||||
},
|
||||
|
||||
buildAttributes(attrs) {
|
||||
return { "data-id": attrs.item.id };
|
||||
return {
|
||||
"data-id": attrs.item.id,
|
||||
tabindex: attrs.item === "separator" ? -1 : 0
|
||||
};
|
||||
},
|
||||
|
||||
buildClasses(attrs) {
|
||||
@ -124,6 +127,13 @@ export const WidgetDropdownItemClass = {
|
||||
].join(" ");
|
||||
},
|
||||
|
||||
keyDown(event) {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
this.sendWidgetAction("_onChange", this.attrs.item);
|
||||
}
|
||||
},
|
||||
|
||||
click(event) {
|
||||
event.preventDefault();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user