MassAutocomplete icon indicating copy to clipboard operation
MassAutocomplete copied to clipboard

stop removing original id of the input

Open velislavbg opened this issue 7 years ago • 3 comments

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

velislavbg avatar Oct 16 '17 22:10 velislavbg

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!

hakib avatar Oct 20 '17 10:10 hakib

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.

velislavbg avatar Nov 02 '17 14:11 velislavbg

OK, LGTM.

If you could squash the two commits i'll merge and pushlish.

Thanks!

hakib avatar Nov 05 '17 07:11 hakib