From 9be52c2d75ea8681fdbdd54ef926316cb04a9b64 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 10 Apr 2018 12:39:27 +0200 Subject: [PATCH] * Api: Fix auto-complete password field gets activated even though user hasn't selected it deliberately. --- api/js/etemplate/et2_widget_textbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_textbox.js b/api/js/etemplate/et2_widget_textbox.js index 9ac38db02b..ec8da5c351 100644 --- a/api/js/etemplate/et2_widget_textbox.js +++ b/api/js/etemplate/et2_widget_textbox.js @@ -119,7 +119,11 @@ var et2_textbox = (function(){ "use strict"; return et2_inputWidget.extend([et2_ case "passwd": this.input.attr("type", "password"); // Make autocomplete default value off for password field - if (this.options.autocomplete === "") this.options.autocomplete = "off"; + // seems browsers not respecting 'off' anymore and started to + // impelement a new key called "new-password" considered as switching + // autocomplete off. + // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion + if (this.options.autocomplete === "" || this.options.autocomplete == "off") this.options.autocomplete = "new-password"; break; case "hidden": this.input.attr("type", "hidden");