From 694441fec5036bf2e5ee6a261b40ada2bfc76d61 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 4 Jun 2022 05:38:26 +0800 Subject: [PATCH] Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) * Remove customized (unmaintained) dropdown, improve aria a11y for dropdown * fix repo permission * use action instead of onChange * re-order the CSS selector * fix dropdown behavior for repo permissions, make elements inside menu item non-focusable * use menu/menuitem instead of combobox/option. use tooltip(data-content) for aria-label, prevent from repeated attaching * click menu item when pressing Enter * code format * fix repo permission * repo setting: prevent from misleading users when error occurs * fine tune the repo collaboration access mode dropdown (in case the access mode is undefined in the template) Co-authored-by: zeripath Co-authored-by: techknowlogick --- Makefile | 1 - templates/repo/settings/collaboration.tmpl | 10 +- web_src/fomantic/build/semantic.js | 104 +- web_src/js/features/aria.js | 100 + web_src/js/features/aria.md | 46 + web_src/js/features/common-global.js | 12 +- web_src/js/features/repo-settings.js | 37 +- web_src/js/vendor/dropdown.js | 4338 -------------------- web_src/less/_form.less | 6 +- 9 files changed, 195 insertions(+), 4459 deletions(-) create mode 100644 web_src/js/features/aria.js create mode 100644 web_src/js/features/aria.md delete mode 100644 web_src/js/vendor/dropdown.js diff --git a/Makefile b/Makefile index fed225b16..8ce7a0aa6 100644 --- a/Makefile +++ b/Makefile @@ -703,7 +703,6 @@ fomantic: cd $(FOMANTIC_WORK_DIR) && npm install --no-save cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/ - cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build rm -f $(FOMANTIC_WORK_DIR)/build/*.min.* diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 0a56b5b6b..13972cd91 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -19,13 +19,13 @@
{{svg "octicon-shield-lock"}} -