From fa2d0517c507ec251815d5c06b89ba5907e5246c Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 20 Jul 2021 18:49:29 +0200 Subject: [PATCH] Editor: Turn off autocomplete of input elements. (#22157) --- editor/js/libs/ui.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editor/js/libs/ui.js b/editor/js/libs/ui.js index 127d276388..f68709b449 100644 --- a/editor/js/libs/ui.js +++ b/editor/js/libs/ui.js @@ -267,6 +267,8 @@ class UIInput extends UIElement { this.dom.style.padding = '2px'; this.dom.style.border = '1px solid transparent'; + this.dom.setAttribute( 'autocomplete', 'off' ); + this.dom.addEventListener( 'keydown', function ( event ) { event.stopPropagation(); @@ -303,6 +305,8 @@ class UITextArea extends UIElement { this.dom.style.padding = '2px'; this.dom.spellcheck = false; + this.dom.setAttribute( 'autocomplete', 'off' ); + this.dom.addEventListener( 'keydown', function ( event ) { event.stopPropagation(); @@ -348,6 +352,8 @@ class UISelect extends UIElement { this.dom.className = 'Select'; this.dom.style.padding = '2px'; + this.dom.setAttribute( 'autocomplete', 'off' ); + } setMultiple( boolean ) { @@ -452,6 +458,8 @@ class UIColor extends UIElement { this.dom.style.padding = '2px'; this.dom.style.backgroundColor = 'transparent'; + this.dom.setAttribute( 'autocomplete', 'off' ); + try { this.dom.type = 'color'; @@ -501,6 +509,8 @@ class UINumber extends UIElement { this.dom.className = 'Number'; this.dom.value = '0.00'; + this.dom.setAttribute( 'autocomplete', 'off' ); + this.value = 0; this.min = - Infinity; @@ -767,6 +777,8 @@ class UIInteger extends UIElement { this.dom.className = 'Number'; this.dom.value = '0'; + this.dom.setAttribute( 'autocomplete', 'off' ); + this.value = 0; this.min = - Infinity; -- GitLab