Ticket #5640 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

Combobox/Autocomplete doesn't save value unless control loses focus

Reported by: vanboom Owned by:
Priority: major Milestone: 1.8.3
Component: ui.autocomplete Version: 1.8.1
Keywords: Cc:
Blocking: Blocked by:

Description

To reproduce: 1) create a form with a combobox control 2) click the dropdown in the combobox control and select an item 3) click the form's submit button without tabbing out of the combobox 4) the value of the combobox will not be posted with the form

If you tab away from the combobox or click another control on the form so the combobox loses focus, then hit the submit button, it works perfectly.

Change History

comment:1 in reply to: ↑ description Changed 5 years ago by Ascold

To fix it, recommended to add this text block into widget->ui.combobox->autocomplete initialisation:


.autocomplete({

...,

select: function(event, ui){

select.val(ui.item.id); self._trigger("selected", event, {

item: select.find("[value='" + ui.item.id + "']")

});

},

...

})

comment:2 in reply to: ↑ description Changed 5 years ago by mgurley

I fixed this problem by adding the following:

.autocomplete({

...,

select: function(event, ui) {

$(this).trigger('blur.autocomplete');

},

...

})

comment:3 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from TBD to 1.9

Fixed in  ba09165.

comment:4 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.3
Note: See TracTickets for help on using tickets.