Opened 5 years ago

Closed 5 years ago

#15154 closed bug (notabug)

Autocomplete, change event doesn't fire when clear field after selection but still keeping the focus on it

Reported by: maglioccola Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by maglioccola)

I provided a simple snippet, please see: https://jsfiddle.net/zcaszs38/2/

When I put the string 'value' in the editable field, autocomplete appears correctly, so I can select one value and put it in the textbox with id hiddenField. Then, if I clear the value in the textbox, I can't update the related hiddenField with a blank value, because change event doesn't fire. Why?

Steps to test snippet:

Write 'value' in the editable field

  • Select one value
  • Clear the selected value
  • hiddenField will still contain old value.

Thanks

Note: It doesn't work when I clear the field after selection but still keeping the focus on it.

Change History (3)

comment:1 Changed 5 years ago by maglioccola

comment:2 Changed 5 years ago by maglioccola

Description: modified (diff)

comment:3 Changed 5 years ago by Scott González

Resolution: notabug
Status: newclosed

Selecting the item by pressing enter has not caused the value to change because the field has not blurred. When you fully clear the value then press tab, the new value (empty) and the old value (empty) are the same, so no change has occurred.

Note: See TracTickets for help on using tickets.