Skip to content

Commit

Permalink
Made sure blank / null text is not added to the history manager by th…
Browse files Browse the repository at this point in the history
…e SearchField and the SearchTextField.
  • Loading branch information
dlemmermann committed May 31, 2024
1 parent 58d2e2e commit 098991b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gemsfx/src/main/java/com/dlsc/gemsfx/SearchField.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public void commit() {

private void addToHistory(String text) {
HistoryManager<String> historyManager = getHistoryManager();
if (historyManager != null) {
if (historyManager != null && StringUtils.isNotBlank(text)) {
historyManager.add(text);
}
}
Expand Down
5 changes: 4 additions & 1 deletion gemsfx/src/main/java/com/dlsc/gemsfx/SearchTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ public SearchTextField() {
private void addToHistory() {
HistoryManager<String> historyManager = getHistoryManager();
if (historyManager != null) {
historyManager.add(getText());
String text = getText();
if (StringUtils.isNotBlank(text)) {
historyManager.add(text);
}
}
}

Expand Down

0 comments on commit 098991b

Please sign in to comment.