-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textarea's initial value is emptied in component if it contains html tags #5121
Comments
Because the component template is compiled by vue while the other one is interpreted by the browser before vue can compile it. Maybe we could add a development warning, but basically, you cannot write unescaped HTML inside of a textarea. More specifically, you can only write text. The browser escapes it for convenience I guess. |
Great, makes sense, it works with escaped HTML. I didn't even think about escaping since it worked in v1. |
Technically we can make the HTML parser treat the entire content of |
I can try that, I'm not sure I will manage to do that but I will try |
* 'dev' of https://github.com/vuejs/vue: (118 commits) [weex] Support unary and left open tags (vuejs#5052) [release] 2.2.4 [build] 2.2.4 fix perf measure regression for nested components of the same name (fix vuejs#5181) [release] 2.2.3 [build] 2.2.3 perf code coverage improve camelCase prop warning message warn when template contains text outside root element (vuejs#5164) Warn when not passing props in kebab-case (vuejs#5161) turn off perf timeline measuring by default + reduce its impact on dev time perf (fix vuejs#5174) v-bind object should have lower priority than explicit bindings (fix vuejs#5150) fix custom directive arg fall through (fix vuejs#5162) formatting tweaks refactor create-component fix wrong order of generate modifier code (vuejs#5147) fix v-on unit test (vuejs#5144) fix vuejs#5121: parse content in textarea as plaintext (vuejs#5143) [release] 2.2.2 [build] 2.2.2 ... # Conflicts: # dist/vue.runtime.common.js # src/core/vdom/helpers/update-listeners.js
Jsfiddle vue v2.2.1: https://jsfiddle.net/dobuznsc/1/
Jsfiddle vue v1.0.12: https://jsfiddle.net/dobuznsc/2/
As you can see, there're 3 textareas and inputs in 3 different scopes:
My question is, why are textareas in root and component scope handled differently, is this a bug?
The text was updated successfully, but these errors were encountered: