Skip to content

Commit 1835574

Browse files
committed
Force autocomplete to reset internal state when invalid value is entered
1 parent 07fe004 commit 1835574

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ui/jquery.ui.combobox.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@
146146
if ( !valid ) {
147147

148148
// remove invalid value, as it didn't match anything
149-
$el.val( "" );
149+
$el.val( '' );
150+
151+
// Internally, term must change before another search is performed
152+
// if the same search is performed again, the menu won't be shown
153+
// because the value didn't actually change via a keyboard event
154+
$el.data( 'ui-autocomplete' ).term = '';
155+
150156
this.element.prop('selectedIndex', -1);
151-
//return false;
152157

153158
}
154159
}

0 commit comments

Comments
 (0)