Ticket #5757 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Autocomplete combobox issues

Reported by: joern.zaefferer Owned by:
Priority: minor Milestone: 1.8.3
Component: ui.autocomplete Version: 1.8.2
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by joern.zaefferer) (diff)

From  http://forum.jquery.com/topic/autocomplete-combobox-from-documentation-bugs:

The autocomplete combobox has the following bugs:

   1. submits forms when you select an item
   2. does not take into account the initially selected option
   3. you cannot set the value of the combobox programatically

I solved these issues and the code I added will work for jQuery ui 1.8.

Note: I also have a 'set_empty' call that will only set the combobx if it is empty.  I was using this for starting with a value if one had not been previously set.  Feel free to rip it out if you don't want/need it.

Initializing the input with the value of the select is a no-brainer. Need to look at the others. The provided implementation would need to be refactored to use the set-method in the select-event.

In Chrome 5, enter a charakter and backspace: The resulting menu gets way too wide.

Change History

comment:1 Changed 4 years ago by joern.zaefferer

  • Description modified (diff)

comment:2 Changed 4 years ago by gavimobile

can you give us a full working example.

i applied the code and it works but i want to POST values which arent in the dropdown and get the value with php. eg. echo $_POSTcombobox_field?;

thanks

comment:3 Changed 4 years ago by scott.gonzalez

Fixed initial value in  123467a.

comment:4 Changed 4 years ago by scott.gonzalez

Fixed form submission in  e85615f.

comment:5 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed

Please open separate tickets for any remaining features. For setting a value programmatically, you can currently do:

$("#combobox").next().val("java").blur();

We can flesh out more functionality when this is an actual plugin and not just a demo.

comment:6 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.3

comment:7 Changed 3 years ago by dvdckl

  • Status changed from closed to reopened
  • Resolution fixed deleted

This commit broke the use case where the user is allowed to submit text by hitting enter in order to ignore search suggestions shown in the autocomplete widget:  e85615f

Is there a recommended workaround? Can we make this behavior an option of autocomplete?

comment:8 Changed 3 years ago by scott.gonzalez

  • Status changed from reopened to closed
  • Resolution set to fixed

That change has actually been reverted in master and will go out with 1.8.6.

Note: See TracTickets for help on using tickets.