masto-fe/app/javascript/mastodon/actions/dropdown_menu.js
ThibG f8160b68b3 Only focus first element of dropdown menus if using keyboard (#8679)
* Only focus first item of dropdown if it was opened via keyboard

* Improve keyboard VS mouse navigation of dropdown menus
2018-09-13 20:31:33 +02:00

10 lines
328 B
JavaScript

export const DROPDOWN_MENU_OPEN = 'DROPDOWN_MENU_OPEN';
export const DROPDOWN_MENU_CLOSE = 'DROPDOWN_MENU_CLOSE';
export function openDropdownMenu(id, placement, keyboard) {
return { type: DROPDOWN_MENU_OPEN, id, placement, keyboard };
}
export function closeDropdownMenu(id) {
return { type: DROPDOWN_MENU_CLOSE, id };
}