Skip to content

Commit 77ee1f1

Browse files
committed
add more comments
1 parent fa2fa02 commit 77ee1f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web_src/js/features/repo-home.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ export function initRepoTopicBar() {
150150
},
151151
onLabelCreate(value) {
152152
value = value.toLowerCase().trim();
153-
// keep the same as template (repo-topic-label)
154-
const $el = $(`<div class="ui small label topic" data-value="${htmlEscape(value)}" >${htmlEscape(value)}<i class="delete icon"></i></div>`);
153+
// `this` is the default label jQuery element, it's "<a class="ui small label">"
154+
// we create a new div element to replace it, to keep the same as template (repo-topic-label), because we do not want the `<a>` tag to affect aria focus.
155+
const $el = $(`<div class="ui small label topic" data-value="${htmlEscape(value)}">${htmlEscape(value)}<i class="delete icon"></i></div>`);
155156
addLabelDeleteIconAria($el.find('i.delete.icon'));
156157
return $el;
157158
},

0 commit comments

Comments
 (0)