You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wxiaoguang 345aa09756
Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450)
This PR is extracted from #23346 to address some unclear (I don't
understand) code-belonging concerns.

This PR needs to be backported, otherwise the `aria.js` is too buggy in
some cases. Since there would be two minor conflicts, I will do the
backport manually.

Before: the `aria.js` is still buggy in some cases.

After: tested with AppleVoice, Android TalkBack

* 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
* Hide item's tippy after menu gets hidden
* Fix incorrect tippy `setProps` after `destroy`
* Fix UI lag problem when page gets redirected during menu hiding
animation with screen reader
* Improve comments
* Implement the layout proposed by #19861

<details>


d74a7efb60/web_src/js/features/aria.md?plain=1#L38-L47

</details>
1 year ago
..
fields Fix nil context in RenderMarkdownToHtml (#23092) 1 year ago
labels Convert `<div class="button">` to `<button class="button">` (#23337) 1 year ago
view_content Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (#23450) 1 year ago
branch_selector_field.tmpl Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago
choose.tmpl Add main landmark to templates and adjust titles (#22670) 1 year ago
comment_tab.tmpl Fix nil context in RenderMarkdownToHtml (#23092) 1 year ago
label_precolors.tmpl Fix purple color in suggested label colors (#18241) 3 years ago
labels.tmpl Convert `<div class="button">` to `<button class="button">` (#23337) 1 year ago
list.tmpl Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) 1 year ago
milestone_issues.tmpl Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) 1 year ago
milestone_new.tmpl Add main landmark to templates and adjust titles (#22670) 1 year ago
milestones.tmpl Convert `<div class="button">` to `<button class="button">` (#23337) 1 year ago
navbar.tmpl Add some headings to repo views (#22869) 1 year ago
new.tmpl Add main landmark to templates and adjust titles (#22670) 1 year ago
new_form.tmpl Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (#23463) 1 year ago
openclose.tmpl Move helpers to be prefixed with `gt-` (#22879) 1 year ago
search.tmpl Issues: add Project filter to issues list and search (#22544) 1 year ago
view.tmpl Add main landmark to templates and adjust titles (#22670) 1 year ago
view_content.tmpl Change `Close` to either `Close issue` or `Close pull request` (#23506) 1 year ago
view_title.tmpl Convert `<div class="button">` to `<button class="button">` (#23337) 1 year ago