/** For internal use only. May be removed or replaced in the future. */
public boolean updateSelectionWhenReponseIsReceived = false;
+ private boolean tabPressedWhenPopupOpen = false;
+
/** For internal use only. May be removed or replaced in the future. */
public boolean initDone = false;
event.stopPropagation();
break;
case KeyCodes.KEY_TAB:
+ tabPressedWhenPopupOpen = true;
+ waitingForFilteringResponse = false;
case KeyCodes.KEY_ENTER:
if (!allowNewItem) {
focused = false;
if (!readonly) {
+ if (tabPressedWhenPopupOpen) {
+ tabPressedWhenPopupOpen = false;
+ waitingForFilteringResponse = false;
+ } else if ((!suggestionPopup.isAttached() && waitingForFilteringResponse)
+ || suggestionPopup.isJustClosed()) {
+ // typing so fast the popup was never opened, or it's just
+ // closed
+ waitingForFilteringResponse = false;
+ }
if (textInputEnabled && allowNewItem) {
suggestionPopup.menu.doSelectedItemAction();
}