Skip to content
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

Line breaks in textarea are excessively removed. #11446

Open
KUBOTAfumiya opened this issue Jun 10, 2020 · 2 comments · May be fixed by #11463
Open

Line breaks in textarea are excessively removed. #11446

KUBOTAfumiya opened this issue Jun 10, 2020 · 2 comments · May be fixed by #11463
Labels

Comments

@KUBOTAfumiya
Copy link

Version

2.6.11

Reproduction link

https://codepen.io/kubotafumiya/pen/qBOwEOV

Steps to reproduce

  1. Set the el option to an element that contains a textarea (or pre) with a newline at the beginning, and create a Vue instance.
<div id="app">
<textarea>


Three line breaks are ignored.
</textarea>
</div>
new Vue({
  el: '#app',
});

What is expected?

The line breaks are removed.

What is actually happening?

Line breaks are not deleted.


https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions

I think it's okay for a single line break to be ignored according to this specification.

@wonhyoung05
Copy link

I found the reason. Can i take this issue.

@posva
Copy link
Member

posva commented Jun 15, 2020

@wonhyoung05 Yes, I couldn't find an existing issue or PR for this problem

@posva posva added the bug label Jun 16, 2020
wonhyoung05 added a commit to wonhyoung05/vue that referenced this issue Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants