summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-03-08 23:18:53 +0800
committerGitHub <noreply@github.com>2023-03-08 23:18:53 +0800
commitcd7bd8568ce45fde21dab566ff74a899056f4ec0 (patch)
tree2ea9473d993ff44d8fed80793ffee9d2950ff65f /web_src
parentcf80f829b49b35fd91854798f9ead913145782f1 (diff)
downloadgitea-cd7bd8568ce45fde21dab566ff74a899056f4ec0.tar.gz
gitea-cd7bd8568ce45fde21dab566ff74a899056f4ec0.zip
Fix incorrect display for comment context menu (#23343) (#23344)
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>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/aria.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/web_src/js/features/aria.js b/web_src/js/features/aria.js
index 373d667c5f..46944336ad 100644
--- a/web_src/js/features/aria.js
+++ b/web_src/js/features/aria.js
@@ -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();
}
});