Index: src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java	(revision 15105)
+++ src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java	(working copy)
@@ -9,6 +9,8 @@
 import java.awt.FlowLayout;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.util.Arrays;
@@ -118,6 +120,7 @@
         standardSearch = new JRadioButton(tr("standard"), !searchSettings.regexSearch && !searchSettings.mapCSSSearch);
         regexSearch = new JRadioButton(tr("regular expression"), searchSettings.regexSearch);
         mapCSSSearch = new JRadioButton(tr("MapCSS selector"), searchSettings.mapCSSSearch);
+
         ButtonGroup bg2 = new ButtonGroup();
         bg2.add(standardSearch);
         bg2.add(regexSearch);
@@ -165,7 +168,7 @@
          * every time the content of the field has changed. If the query is incorrect, then
          * the text field is colored red.
          */
-        document.addDocumentListener(new AbstractTextComponentValidator(editorComponent) {
+        AbstractTextComponentValidator validator = new AbstractTextComponentValidator(editorComponent) {
 
             @Override
             public void validate() {
@@ -190,7 +193,16 @@
                     return false;
                 }
             }
-        });
+        };
+        document.addDocumentListener(validator);
+        ItemListener validateActionListener = e -> {
+            if (e.getStateChange() == ItemEvent.SELECTED) {
+                validator.validate();
+            }
+        };
+        standardSearch.addItemListener(validateActionListener);
+        regexSearch.addItemListener(validateActionListener);
+        mapCSSSearch.addItemListener(validateActionListener);
 
         /*
          * Setup the logic to append preset queries to the search text field according to
@@ -326,7 +338,7 @@
                         trc("search string example", "user:anonymous (objects without an assigned author)"))
                 .addKeyword("id:", "id:", tr("objects with given ID"),
                         trc("search string example", "id:0 (new objects)"))
-                .addKeyword("version:", "version:", tr("objects with given version"), 
+                .addKeyword("version:", "version:", tr("objects with given version"),
                         trc("search string example", "version:0 (objects without an assigned version)"))
                 .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID"),
                         trc("search string example", "changeset:0 (objects without an assigned changeset)"))
