-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Handle whitespace inside #each with animation #5477
Handle whitespace inside #each with animation #5477
Conversation
This was a while ago now, but can we merge? It feels like a fairly safe change. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
88cea82
to
ad7b1fd
Compare
@benmccann No worries. I rebased it now; seems to still work. |
Thanks for rebasing @ehrencrona. As a heads up, @tanhauhau had suggested discussing this PR at tomorrow's maintainer's meeting if you'd like to join |
This could possible fix/help fix #7124 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've moved the test to a validator test to validate there's no compile error
* Strip out whitespace inside each when it has an animation * remove accidentally committed file * lint * add test to validate no error * update changelog Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: tanhauhau <lhtan93@gmail.com> Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
* Strip out whitespace inside each when it has an animation * remove accidentally committed file * lint * add test to validate no error * update changelog Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: tanhauhau <lhtan93@gmail.com> Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
* Strip out whitespace inside each when it has an animation * remove accidentally committed file * lint * add test to validate no error * update changelog Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: tanhauhau <lhtan93@gmail.com> Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
* Strip out whitespace inside each when it has an animation * remove accidentally committed file * lint * add test to validate no error * update changelog Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: tanhauhau <lhtan93@gmail.com> Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
Fixes #5415: If there is stray whitespace inside an
#each
block that contains an animating element, strip the whitespace out during parsing. This makes sure that the check for whether there is only a single animating child passes.I guess this means there's a risk that the semantics change subtly if animating inline blocks: you might expect them to be separated by whitespace but they won't be. On the other hand, since we don't support having more than one element animating it's kind of unavoidable. One could conceivably fix this by adding a
<span>
around the whole output, but I can't overview the consequences of that.Before submitting the PR, please make sure you do the following
Tests
npm test
and lint the project withnpm run lint