From 420d015b76a49e1018c3f1b73ce3b9f72d86f78c Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 19 Mar 2023 00:14:19 +0800 Subject: [PATCH] Fix `aria.js` bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450) (#23486) Before: the `aria.js` is still buggy in some cases. After: tested with AppleVoice, Android TalkBack (I tested it with 1.19 again) * Fix incorrect dropdown init code * Fix incorrect role element (the menu role should be on the `$menu` element, but not on the `$focusable`) * Fix the focus-show-click-hide problem on mobile. Now the language menu works as expected * Fix incorrect dropdown template function setting * Clarify the logic in aria.js * Fix incorrect tippy `setProps` after `destroy` * Improve comments * Implement the layout proposed by #19861 --- templates/base/footer_content.tmpl | 2 +- .../repo/issue/view_content/add_reaction.tmpl | 2 +- .../repo/issue/view_content/context_menu.tmpl | 2 +- web_src/js/features/aria.js | 165 ++++++++++++------ web_src/js/features/aria.md | 81 +++++++-- web_src/js/features/common-global.js | 35 ++-- web_src/js/features/repo-legacy.js | 3 - web_src/js/modules/tippy.js | 3 +- 8 files changed, 203 insertions(+), 90 deletions(-) diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index c3b96a0245..53d0a2c77c 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -21,7 +21,7 @@ {{end}}