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

Spread + bind:value in <svelte:component> throw console errors when typing in input box. #1433

Closed
Kiho opened this issue May 7, 2018 · 3 comments
Labels

Comments

@Kiho
Copy link
Contributor

Kiho commented May 7, 2018

When type something in this REPL throws error in console.
https://svelte.technology/repl?version=2.5.0&gist=0f246a56ffc46239e1d1fc1448f18d4a
If I remove {...settings} in Container.html then it works fine.
Same code in 2.4.3 works without any issues but does not work with 2.4.4 or later.

@Kiho
Copy link
Contributor Author

Kiho commented May 8, 2018

Looks like problem is on this code.

        var switch_instance_changes = {};
	var switch_instance_changes = changed.settings && getSpreadUpdate(switch_instance_spread_levels, [
		ctx.settings
	]);

Maybe we can fix it like this

	var switch_instance_changes = {};
	if (changed.settings) {
		switch_instance_changes = getSpreadUpdate(switch_instance_spread_levels, [
			ctx.settings
		]);
	}

@Kiho
Copy link
Contributor Author

Kiho commented May 8, 2018

I found workaround... add computed prop then work.

	computed:{
		settings: (all) => { 
			return all.settings;
		},
.......

https://svelte.technology/repl?version=2.5.0&gist=47c0e86836c4088475dccecbcfc75153

@Rich-Harris
Copy link
Member

fixed in 2.6.2, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants