Skip to content

Implement the feature that close issuse as archived/merged/resolved #23522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57cb23d
button & dropdown
sillyguodong Mar 16, 2023
13a5e3d
fix style of button & dropdown
sillyguodong Mar 16, 2023
1eb8b18
dropdown item add click event
sillyguodong Mar 16, 2023
b7ab794
dropdown js
sillyguodong Mar 16, 2023
96cca04
dropdown use fomanticUI component
sillyguodong Mar 17, 2023
9516184
complete ui
sillyguodong Mar 17, 2023
4a9e672
implement basically
sillyguodong Mar 17, 2023
4af0bcd
fix lint
sillyguodong Mar 17, 2023
ba8b08b
Merge branch 'main' into feature/issue_22793
sillyguodong Mar 17, 2023
71c03a5
keep active
sillyguodong Mar 17, 2023
baf2ab7
mark the comobox with classname 'js-aria-comobox'
sillyguodong Mar 17, 2023
a12c386
Merge branch 'main' into feature/issue_22793
sillyguodong Mar 20, 2023
7b68c3f
use svg instead of fomantic icon
sillyguodong Mar 20, 2023
b625d55
use selected
sillyguodong Mar 20, 2023
2de28aa
use selected in dropdown
sillyguodong Mar 20, 2023
1c6365e
demo
wxiaoguang Mar 20, 2023
d7db875
fix
sillyguodong Mar 20, 2023
f1ff475
fix
sillyguodong Mar 20, 2023
d0ce23f
fix lint
sillyguodong Mar 20, 2023
42cc712
fix
sillyguodong Mar 20, 2023
466fcb3
fix lint
sillyguodong Mar 20, 2023
69d46a9
rename closed status
sillyguodong Mar 21, 2023
4c092df
Merge branch 'main' into feature/issue_22793
sillyguodong Mar 21, 2023
cb2accb
add migration
sillyguodong Mar 21, 2023
f117aa0
fix and add tooltip
sillyguodong Mar 21, 2023
099fd27
Merge branch 'main' into feature/issue_22793
sillyguodong Mar 22, 2023
04e98a0
lint
sillyguodong Mar 22, 2023
3ce31c8
Merge branch 'main' into feature/issue_22793
sillyguodong Mar 22, 2023
f8b80f0
fix css format
sillyguodong Mar 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</div>
{{end}}
{{if not .Issue.IsPull}}
<div id="status-dropdown" class="ui floating dropdown icon button">
<div id="status-dropdown" class="ui floating dropdown icon button keep-active">
<i class="dropdown icon"></i>
<div class="menu" tabindex="-1">
{{if not (eq .Issue.Status 1)}}
Expand Down
7 changes: 5 additions & 2 deletions web_src/js/features/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ function attachOneDropdownAria($dropdown) {
const listPopupRole = isComboBox ? 'listbox' : 'menu';
const listItemRole = isComboBox ? 'option' : 'menuitem';

const needKeepAtive = $dropdown.hasClass('keep-active');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wxiaoguang hi, in this case, i need to keep check icon active even if the menu is hidden and reopened.
So, I add a classname 'keep-active' to the dropdown. But I'm not sure that's a good idea. Do you have better one?
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have commented above 😂


// make the item has role=option/menuitem, add an id if there wasn't one yet, make items as non-focusable
// the elements inside the dropdown menu item should not be focusable, the focus should always be on the dropdown primary element.
function prepareMenuItem($item) {
Expand Down Expand Up @@ -97,8 +99,9 @@ function attachOneDropdownAria($dropdown) {
// if the popup is visible and has an active/selected item, use its id as aria-activedescendant
if (menuVisible) {
$focusable.attr('aria-activedescendant', $active.attr('id'));
} else if (!isComboBox) {
// for menu, when the popup is hidden, no need to keep the aria-activedescendant, and clear the active/selected item
} else if (!isComboBox && !needKeepAtive) {
// for menu in most cases, when the popup is hidden, no need to keep the aria-activedescendant, and clear the active/selected item
// if you really need to keep the aria-activedescendant, plz add a className 'keep-active' to the dropdown
Copy link
Contributor

@wxiaoguang wxiaoguang Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menu doesn't keep last selected item, and it would break some screen readers IIRC.

You need to make it a combobox.

For example: class=js-aria-comobox, then isCombobox=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, a quick comment~That's exactly what I wanted to ask you.

$focusable.removeAttr('aria-activedescendant');
$active.removeClass('active').removeClass('selected');
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function initRepoIssueStatusDropdown() {
const $statusMenu = $statusDropdown.find('> .menu');
$statusMenu.find('> .item').each((_, item) => {
$(item).on('click', (e) => {
// e.preventDefault();
e.preventDefault();
// rerender "check" icon
$statusMenu.find('> .item').removeClass('active');
$(item).addClass('active');
Expand Down