Browse Source

work around IE textarea placeholder innerHTML/outerHTML bug (fix #4098)

Evan You 9 years ago
parent
commit
ab277adfbe
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/compiler/parser/index.js

+ 7 - 0
src/compiler/parser/index.js

@@ -211,6 +211,13 @@ export function parse (
         }
         }
         return
         return
       }
       }
+      // IE textarea placeholder bug
+      /* istanbul ignore if */
+      if (options.isIE &&
+          currentParent.tag === 'textarea' &&
+          currentParent.attrsMap.placeholder === text) {
+        return
+      }
       text = inPre || text.trim()
       text = inPre || text.trim()
         ? decodeHTMLCached(text)
         ? decodeHTMLCached(text)
         // only preserve whitespace if its not right after a starting tag
         // only preserve whitespace if its not right after a starting tag