From 7392bf241f115a9a338e047187be1b1d1ddfaed6 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Wed, 10 Apr 2019 14:42:58 +0300 Subject: Fixing autocompletion issue with ComboBox on newer Chrome versions (#11524) Newer Chrome versions do not work with random number hack to prevent auto completion, but it finally supports autocomplete=off. Adapted from https://github.com/vaadin/framework/pull/11472 Fixes #11437 --- .../src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compatibility-client') diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java index 726efb5ec3..86fa8ed500 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java @@ -1420,7 +1420,12 @@ public class VFilterSelect extends Composite * 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() + ""); + } } /** -- cgit v1.2.3