@@ -987,6 +987,8 @@ applyStyleToElement(el, style, defaultBg = "default") {
987987 if ( ! input || ! input . tagName || input . tagName . toLowerCase ( ) === "textarea" ) return input ;
988988 const owner = input . ownerDocument || ( typeof document !== "undefined" ? document : null ) ;
989989 if ( ! owner ) return input ;
990+ const inputType = ( input . type || "" ) . toLowerCase ( ) ;
991+ if ( inputType === "password" ) return input ;
990992
991993 const ta = owner . createElement ( "textarea" ) ;
992994 ta . name = input . name ;
@@ -1129,7 +1131,8 @@ applyStyleToElement(el, style, defaultBg = "default") {
11291131 const el = e . target ;
11301132 if ( ! el || el . tagName !== "INPUT" ) return ;
11311133 const t = ( el . type || "text" ) . toLowerCase ( ) ;
1132- if ( t !== "text" && t !== "password" && t !== "" ) return ;
1134+ if ( t === "password" ) return ;
1135+ if ( t !== "text" && t !== "" ) return ;
11331136 if ( filter && ! filter ( el ) ) return ;
11341137
11351138 const now = Date . now ( ) ;
@@ -1186,7 +1189,7 @@ applyStyleToElement(el, style, defaultBg = "default") {
11861189 if ( typeof selectorOrPredicate === "string" ) {
11871190 candidates = Array . from ( root . querySelectorAll ( selectorOrPredicate ) ) ;
11881191 } else if ( typeof selectorOrPredicate === "function" ) {
1189- const all = Array . from ( root . querySelectorAll ( 'input[type="text"], input[type="password"], input :not([type])' ) ) ;
1192+ const all = Array . from ( root . querySelectorAll ( 'input[type="text"], input:not([type])' ) ) ;
11901193 for ( const el of all ) {
11911194 const info = {
11921195 name : el . name ,
@@ -1213,6 +1216,7 @@ applyStyleToElement(el, style, defaultBg = "default") {
12131216
12141217 const upgraded = [ ] ;
12151218 for ( const el of candidates ) {
1219+ if ( el && el . type && el . type . toLowerCase ( ) === "password" ) continue ;
12161220 const opts = el . _micronUpgradeOpts || options ;
12171221 if ( el . _micronUpgradeOpts ) delete el . _micronUpgradeOpts ;
12181222 upgraded . push ( MicronParser . upgradeInputToTextarea ( el , opts ) ) ;
0 commit comments