-
Bug
-
Resolution: Unresolved
-
Minor
When using auto-completion on a textbox, and using the enter key instead of clicking the value to select a value in the drop-drown list, the onChange event is not triggered. That could make sense if it was when leaving the field, but it's not as well, I guess the browser thinks the value haven't changed since it is set via setting the value attribute directly on the input field, here is where it's happening:
YAHOO.widget.AutoComplete._updateValue (autocomplete-mi…:formatted:995) YAHOO.widget.AutoComplete._selectItem (autocomplete-mi…formatted:1007) YAHOO.widget.AutoComplete._onTextboxKeyDown (autocomplete-mi…formatted:1204) n (event-min.js:7)
Setting @value doesn't trigger a change event, and leaving the field either.
This is a problem if we have validation as well using checkUrl or doCheck method, because the we can choose a value using enter, leave the field and the value will never be validated.
I was investigating a bit more this issue, and what do you think about adding this at the auto-complete behavior:
in hudson-behavior.js#INPUT.auto-complete:688
IMHO, it makes sense to trigger the change event when an element is selected in the auto-complete list, since looking at the code of the yahoo auto-complete library:
we can see it's firing the selectEvent after updating the value, so the onchange will be using the new value. I tested and that looks like working, meaning triggering the onchange event triggers the validation as well with the correct value (the one from the list, not the partial one entered by the user) . I'm waiting for a few opinions on this but I don't mind contributing this back to git if you think that's a good idea.