tagit fix and ui

This commit is contained in:
NottyNoz
2023-03-26 02:42:25 -04:00
committed by Shish
parent 4253d357af
commit a98560b061
3 changed files with 10 additions and 3 deletions

View File

@ -93,8 +93,14 @@ document.addEventListener('DOMContentLoaded', () => {
//Stop tags containing space.
if(keyCode === 32) {
e.preventDefault();
var el = $('.ui-widget-content:focus');
$('.autocomplete_tags').tagit('createTag', $(this).val());
//Find the correct element in a page with multiple tagit input boxes.
$('.autocomplete_tags').each(function(_,n){
if (n.parentNode.contains(el[0])){
$(n.parentNode).find('.autocomplete_tags').tagit('createTag', el.val());
}
});
$(this).autocomplete('close');
} else if (keyCode === 9) {
e.preventDefault();