Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autocomplete: Fall back to .ui-front searching for empty jQuery objects
Fixes #9755
- Loading branch information
1 parent
0bb807b
commit 2ef1b16
Showing
2 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2ef1b16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottgonzalez thanks for the quick fix! I noticed a similar thing in the dialog widget:
https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.dialog.js#L133
And there may be other widgets that use the same appendTo option, too.
2ef1b16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialog doesn't use the
.ui-front
walking. You can only be explicit.2ef1b16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but you could end up with a case where the dialog wouldn't be appended to anything if an empty jQuery collection was passed in.
2ef1b16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't tend to write defensive code like this. The only reason to use dialog's
appendTo
option is because of forms or the like. If you pass an invalid object, the page is going to be broken anyway.2ef1b16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.