Explorar o código

HUE-8727 [frontend] Prevent chrome from autofilling username in select2 search inputs

Johan Ahlen %!s(int64=6) %!d(string=hai) anos
pai
achega
56ffd27b40
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      desktop/core/src/desktop/js/ko/bindings/ko.select2.js

+ 5 - 0
desktop/core/src/desktop/js/ko/bindings/ko.select2.js

@@ -199,6 +199,11 @@ ko.bindingHandlers.select2 = {
             }
           });
       });
+    $element
+      .data('select2')
+      .search.prop('readOnly', true)
+      .attr('onfocus', 'this.removeAttribute("readonly");')
+      .wrap('<form autocomplete="off">');
   },
   update: function(element, valueAccessor, allBindingsAccessor) {
     if (typeof allBindingsAccessor().visible != 'undefined') {