-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Initialize custom elements in connectedCallback #5139
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
Initialize custom elements in connectedCallback #5139
Conversation
No need for CSS here, the same effect could be achieved with just a `disabled` binding.
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luca Bonavita <[email protected]>
* Initial stab at a blog post * Update site/content/blog/2020-06-04-svelte-and-typescript.md Co-authored-by: pngwn <[email protected]> * Update 2020-06-04-svelte-and-typescript.md * Apply suggestions from code review Co-authored-by: halfnelson <[email protected]> Co-authored-by: Simon H <[email protected]> * Tighten the post * Fix degit sample * Feedback * More feeedback * Handle feedback * Handle all the feedback in the PR * Add a note about the should work * Change date * code style consistency, fix syntax error Co-authored-by: pngwn <[email protected]> Co-authored-by: halfnelson <[email protected]> Co-authored-by: Simon H <[email protected]> Co-authored-by: Rich Harris <[email protected]>
Update from base repo
…tps://github.com/Truffula/svelte into initialize-custom-elements-in-connected-callback
@Truffula you need any help with these merge conflicts? I’m really looking forward to using svelte in a design system but the chat element limitations are my hang up. This and a few of the other PRs help fix that. I’m happy to help! |
@ScottAwesome sure feel free if you want to tackle them! 👍🏻 |
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. |
This pull request has been closed as it was previously marked as stale and saw no subsequent activity. |
When a custom element is created within a block of HTML,
init()
runs before attributes are available becauseattributeChangedCallback()
has not yet fired to provide initial values. The result is that the component code first runs with the default values orundefined
for each property.This change updates the base
SvelteElement
and generated Custom Element code so that the initialisation andonMount()
are deferred untilconnectedCallback()
fires if—and only if—no options object is passed in to the constructor. This means any attributes on the element become available on init, and if any properties are set by JavaScript before DOM insertion (e.g. by a third party framework that binds attributes), they will also be captured and passed in when initialisation runs.Fixes #2227
Affects #4527