Opened 4 years ago

Closed 4 years ago

#9755 closed bug (fixed)

Autocomplete: If the `appendTo` option is an empty jQuery object, it skips the check for `.ui-front`

Reported by: MoonScript Owned by: Scott González
Priority: minor Milestone: 1.11.0
Component: ui.autocomplete Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

If you pass an empty jQuery collection for the "appendTo" option in the autocomplete widget, it will skip the check for the closest "ui-front" element. I think it should do an extra check to handle that case, so it will be consistent in how it looks for elements to append the autocomplete menu to.

So it should check the following:

  1. If "appendTo" element (node) is supplied, use it and don't check anything else.
  2. If "appendTo" jQuery collection is supplied, make sure that its length is > 0. If not, go to #4. (this is where the bug exists today)
  3. If "appendTo" selector (string) is supplied, look for that element. If not found, go to #4.
  4. Look for closest element with a class of "ui-front". If not found, go to #5.
  5. Append to the <body>.

Change History (3)

comment:1 Changed 4 years ago by MoonScript

jsFiddle example that logs the element that the autocomplete menu gets appended to: http://jsfiddle.net/MoonScript/b8A7A/

comment:2 Changed 4 years ago by Scott González

Milestone: none1.11.0
Owner: set to scott.gonzalez
Status: newassigned
Summary: When autocomplete appendTo option is an empty jQuery collection, it skips the check for "ui-front"Autocomplete: If the `appendTo` option is an empty jQuery object, it skips the check for `.ui-front`

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

Resolution: fixed
Status: assignedclosed

Autocomplete: Fall back to .ui-front searching for empty jQuery objects

Fixes #9755

Changeset: 2ef1b16e4d3aa8766084e50f4a1d806c434e7e43

Note: See TracTickets for help on using tickets.