Correctly relate the label to the input

There seems to be a small issue with suggestags, and the label is associated with the
original input
This commit is contained in:
taitus
2021-01-18 12:26:05 +01:00
parent 602b22edfd
commit 2481fc3243

View File

@@ -44,6 +44,7 @@
amsify_suggestags.classes.sTagsInput = ".sdg-related-list-selector-input";
amsify_suggestags._init();
App.SDGRelatedListSelector.manage_icons(amsify_suggestags);
App.SDGRelatedListSelector.fix_label(amsify_suggestags);
}
},
manage_icons: function(amsify_suggestags) {
@@ -79,6 +80,14 @@
if ($(amsify_suggestags.selector).val() === "") {
$(".sdg-related-list-selector .help-section").addClass("hide");
}
},
fix_label: function(amsify_suggestags) {
var original_input = amsify_suggestags.selector;
var suggestions_input = amsify_suggestags.selectors.sTagsInput;
suggestions_input[0].id = original_input[0].id + "_suggestions";
$("[for='" + original_input[0].id + "']").attr("for", suggestions_input[0].id);
}
};
}).call(this);