-
-
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
on:* #3349
Closed
+234
−52
Closed
on:* #3349
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7332146
on:*
matyunya 0b99284
any -> $$any
matyunya 3825b9e
fix for any event
matyunya 085a97c
push bubbles for if/each blocks
matyunya 7c953a8
Merge branch 'master' into master
Rich-Harris 9118bbb
strict order option
matyunya 4c4a39c
lint
matyunya cf39b8b
add test
matyunya 54f9a79
normal order test
matyunya 16edc67
remove solo: true
matyunya 7f2b68e
add docs
matyunya 00910fe
tests reversed
matyunya 521580d
merge master
matyunya 837c93f
Merge branch 'strict-order'
matyunya 6c4439d
Merge branch 'master' of https://github.com/sveltejs/svelte
matyunya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,16 @@ export function mount_component(component, target, anchor) { | |
run_all(new_on_destroy); | ||
} | ||
component.$$.on_mount = []; | ||
|
||
if (fragment.bbl) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless I'm mistaken, this mechanism won't forward events with handlers attached after the component has been mounted. |
||
Object.keys(component.$$.callbacks).forEach(type => { | ||
if (!component.$$.ctx[`${type}_handler`]) { | ||
const [listen, els] = fragment.bbl(); | ||
|
||
els.forEach(el => component.$$.callbacks[type].forEach(cb => listen(el, type, cb))); | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
after_update.forEach(add_render_callback); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This would give
on:any
a different meaning than it already has, which we don't want to do. It's possible that someone has code where they are bubbling an event calledany
, and this would break it. I think elsewhere should just be looking forhandler.name === '*'
directly.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.
Renaming to
$$any
helped. Is it ok way this way?