Просмотр исходного кода

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

Evan You 9 лет назад
Родитель
Сommit
ab277adfbe
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/compiler/parser/index.js

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

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