diff options
author | Tatu Lund <tatu@vaadin.com> | 2019-04-10 14:42:58 +0300 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2019-04-10 14:42:58 +0300 |
commit | 7392bf241f115a9a338e047187be1b1d1ddfaed6 (patch) | |
tree | ac7c9128311add77b29294868337d8563309274c /compatibility-client | |
parent | d213a4244341f52846505aa430677ae58954d04e (diff) | |
download | vaadin-framework-7392bf241f115a9a338e047187be1b1d1ddfaed6.tar.gz vaadin-framework-7392bf241f115a9a338e047187be1b1d1ddfaed6.zip |
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
Diffstat (limited to 'compatibility-client')
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java | 7 |
1 files changed, 6 insertions, 1 deletions
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() + ""); + } } /** |