Преглед изворни кода

Fixing issue with Vaadin 7 combobox when typing and tabing out fast (#12033)

ComboBox does not select or add a new value (in case allowed) if User enters the value by typing and TABs out fast. This bug was originally reported in https://github.com/vaadin/framework/issues/4276 and fixed by https://dev.vaadin.com/review/#/c/3564/6/client/src/com/vaadin/client/ui/VFilterSelect.java. However later some logic of VFilterSelect was refactored by patch acb889336f, which accidentally removed the fix. In this new PR I am re-applying the missing part of the logic (adopted to the new structure)

Fixes https://github.com/vaadin/framework/issues/6671
tags/7.7.24
Tatu Lund пре 4 година
родитељ
комит
63434f9939
No account linked to committer's email address
1 измењених фајлова са 13 додато и 0 уклоњено
  1. 13
    0
      client/src/main/java/com/vaadin/client/ui/VFilterSelect.java

+ 13
- 0
client/src/main/java/com/vaadin/client/ui/VFilterSelect.java Прегледај датотеку

@@ -1553,6 +1553,8 @@ public class VFilterSelect extends Composite
/** 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;

@@ -2200,6 +2202,8 @@ public class VFilterSelect extends Composite
event.stopPropagation();
break;
case KeyCodes.KEY_TAB:
tabPressedWhenPopupOpen = true;
waitingForFilteringResponse = false;
case KeyCodes.KEY_ENTER:

if (!allowNewItem) {
@@ -2480,6 +2484,15 @@ public class VFilterSelect extends Composite

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();
}

Loading…
Откажи
Сачувај