Skip to content

[docs] Fix statement about the order of bind: and on: #7357

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

Merged
merged 5 commits into from
May 18, 2022

Conversation

gtm-nayan
Copy link
Contributor

Turns out I kinda lied in #6887 (oops). The order of definition only affects things when the binding is based on the same event (see #7212). Hopefully it should be clear enough now.

Caveat: according to this SO thread, it'll not hold true in old (pre IE8) browsers, but we don't really have to care about that do we?

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@dummdidumm
Copy link
Member

While this is correct, I'm a little hesitant to add it like this to the docs, simply because it might be a little bloated. While not 100% correct, the previous statement was easier to read and therefore understand. The new way requires elaboration on event timings etc.
A good middle ground might be to just clarify the wording a little - noting that the bound value and the event that is used for that binding under the hood are order-aware.

@Conduitry
Copy link
Member

I don't really see what was wrong with the old one, but I wouldn't be against adjusting it to mention something about how each bind: represents (in part) an implicit on:, and all of these are attached in order.

I do agree that what's in this PR is too wordy for the type of documentation it's being proposed for.

@gtm-nayan
Copy link
Contributor Author

@Conduitry how about now?

@tanhauhau tanhauhau merged commit 5242ab9 into sveltejs:master May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants