Skip to content

Commit a2b1fc7

Browse files
committed
Allow custom match
1 parent b94f1b0 commit a2b1fc7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSearch.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void onKeyUp(KeyUpEvent event) {
183183
reset(obj.getKeyword());
184184
});
185185
// If matches add to search result container and object to temp searches
186-
if (obj.getKeyword().toLowerCase().contains(keyword)) {
186+
if (match(obj, keyword)) {
187187
searchResultPanel.add(link);
188188
tempSearches.add(obj);
189189
}
@@ -241,6 +241,10 @@ private void reset(String keyword) {
241241
}));
242242
}
243243

244+
protected boolean match(SearchObject obj, String keyword) {
245+
return obj.getKeyword().toLowerCase().contains(keyword);
246+
}
247+
244248
@Override
245249
protected void onUnload() {
246250
super.onUnload();

0 commit comments

Comments
 (0)