MassAutocomplete
MassAutocomplete copied to clipboard
stop removing original id of the input
Current code always removes id of the input when input loses focus (detach). Desired behaviour is to remove id only when a "runtime" id is set on attach-ing :
if (current_element_random_id_set) {
current_element[0].removeAttribute('id');
}
Removing ID happens always because checking whether element has id should be reciprocal to validation when assigning "operational" id of the input i.e.to check element[0] , not element.
changes on lines 149 and 150
Hey @velislavbg,
You are right - this is a mistake.
The attributes aria-labelledby
and aria-activedescendant
are using the generated id's to point to the targeted element and currently selected suggestio. Can you verify that when there is an ID on the target field they are set correctly? I suspect that aria-labelledby
might suffer from the same issue (as id
is now set on the underlying object and not on an "angular" element).
Thanks for the PR!
You are right : aria-labelledby
has a wrong value when we have predefined id, i have changed the code in my fork
I have not used so highly customized suggestion list to come upon a problem with aria-activedescendant
.
OK, LGTM.
If you could squash the two commits i'll merge and pushlish.
Thanks!