]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixing autocompletion issue with ComboBox on newer Chrome versions (#11472)
authorTatu Lund <tatu@vaadin.com>
Wed, 10 Apr 2019 10:07:43 +0000 (13:07 +0300)
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>
Wed, 10 Apr 2019 10:07:42 +0000 (13:07 +0300)
* Fixing autocompletion issue with ComboBox on newer Chrome versions

Newer Chrome versions do not work with random number hack to prevent auto completion, but it finally supports autocomplete=off.

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

* Merge branch 'master' into fix11437

client/src/main/java/com/vaadin/client/ui/VComboBox.java

index 95e4505d68c68b149c7bbbf66ae19a06f88767ad..fbac85c2af715d525421cf8466755b867d198e70 100644 (file)
@@ -1372,7 +1372,12 @@ public class VComboBox extends Composite implements Field, KeyDownHandler,
              * way, and they might be useful in a combo box where new items are
              * allowed.
              */
-            getElement().setAttribute("autocomplete", Math.random() + "");
+            if (BrowserInfo.get().isChrome()) {
+                // Chrome supports "off" and random number does not work with Chrome
+                getElement().setAttribute("autocomplete", "off");                      
+            } else {
+                getElement().setAttribute("autocomplete", Math.random() + "");
+            }
         }
 
         /**