Allow tags to be removed with the keyboard

We improved accessibility by overwriting the setIcon method in the library.
Now we render a button and add the aria-label attribute.
This commit is contained in:
taitus
2021-01-18 12:23:07 +01:00
parent fce844261a
commit 602b22edfd
7 changed files with 23 additions and 6 deletions

View File

@@ -18,6 +18,11 @@
}
};
amsify_suggestags.setIcon = function() {
var remove_tag_text = $(".sdg-related-list-selector .input").data("remove-tag-text");
return '<button aria-label="' + remove_tag_text + '" class="remove-tag ' + this.classes.removeTag.substring(1) + '">&#10006;</button>';
};
amsify_suggestags._settings({
suggestions: $(".sdg-related-list-selector .input").data("suggestions-list"),
whiteList: true,