forked from forgejo/forgejo
Backport #23343 Fix a regression of #23014: the `a` couldn't be used here because Fomantic UI has style conflicts: `.ui.comments .comment .actions a { display: inline-block; }` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
cf80f829b4
commit
cd7bd8568c
2 changed files with 8 additions and 7 deletions
|
@ -83,8 +83,9 @@ function attachOneDropdownAria($dropdown) {
|
|||
if (e.key === 'Enter') {
|
||||
let $item = $dropdown.dropdown('get item', $dropdown.dropdown('get value'));
|
||||
if (!$item) $item = $menu.find('> .item.selected'); // when dropdown filters items by input, there is no "value", so query the "selected" item
|
||||
// if the selected item is clickable, then trigger the click event. in the future there could be a special CSS class for it.
|
||||
if ($item && $item.is('a')) $item[0].click();
|
||||
// if the selected item is clickable, then trigger the click event.
|
||||
// we can not click any item without check, because Fomantic code might also handle the Enter event. that would result in double click.
|
||||
if ($item && ($item.is('a') || $item.is('.js-aria-clickable'))) $item[0].click();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue