mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +08:00
Refs #1631 Fix clearing value on blur in VSearchSelect
This commit is contained in:
parent
4ce5ef8d1b
commit
71678a3017
@ -881,6 +881,17 @@ public class VFilterSelect extends Composite implements Paintable, Field,
|
||||
suggestionPopup.showSuggestions(currentSuggestions, currentPage, totalMatches);
|
||||
}
|
||||
|
||||
protected void handleSelectionOnBlur() {
|
||||
if (tabPressed) {
|
||||
tabPressed = false;
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
suggestionPopup.hide();
|
||||
} else if (!suggestionPopup.isAttached()
|
||||
|| suggestionPopup.isJustClosed()) {
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
}
|
||||
}
|
||||
|
||||
private void setPromptingOn() {
|
||||
if (!prompting) {
|
||||
prompting = true;
|
||||
@ -1208,14 +1219,7 @@ public class VFilterSelect extends Composite implements Paintable, Field,
|
||||
focused = false;
|
||||
if (!readonly) {
|
||||
// much of the TAB handling takes place here
|
||||
if (tabPressed) {
|
||||
tabPressed = false;
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
suggestionPopup.hide();
|
||||
} else if (!suggestionPopup.isAttached()
|
||||
|| suggestionPopup.isJustClosed()) {
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
}
|
||||
handleSelectionOnBlur();
|
||||
if (selectedOptionKey == null) {
|
||||
setPromptingOn();
|
||||
}
|
||||
|
@ -113,6 +113,20 @@ public class VSearchSelect extends VFilterSelect {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleSelectionOnBlur() {
|
||||
if (tabPressed) {
|
||||
tabPressed = false;
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
suggestionPopup.hide();
|
||||
} else if (!suggestionPopup.isAttached()
|
||||
|| suggestionPopup.isJustClosed()) {
|
||||
if (currentSuggestion == null ||
|
||||
!currentSuggestion.getReplacementString().equals(tb.getText()))
|
||||
suggestionPopup.menu.doSelectedItemAction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlur(BlurEvent event) {
|
||||
super.onBlur(event);
|
||||
|
Loading…
Reference in New Issue
Block a user