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

Repeat words in plain text aren't reactive #5931

Closed
i1mT opened this issue Jan 27, 2021 · 8 comments · Fixed by #8394
Closed

Repeat words in plain text aren't reactive #5931

i1mT opened this issue Jan 27, 2021 · 8 comments · Fixed by #8394

Comments

@i1mT
Copy link

i1mT commented Jan 27, 2021

I find this bug just in testing in svelte.dev

Describe the bug
This code does not show "Hello Hello world!" after 1.5 seconds in expect:

<script>
	let name = 'world';
	setTimeout(() => {
		name = 'Hello world!'
	}, 1500)
</script>

<h1>Hello {name}!</h1>

Maybe diff function is not work in expect?

I'm new to svelte, maybe this is just a feature ?

@dummdidumm
Copy link
Member

Interesting find. I can reproduce this. But as soon as I modify the h1 text once (for adding foo), it starts working. Digging further, it seems that the view is not updated if the text before the update is the same as the text that is updated.
h1-content before update: Hello world!
Update to name: also Hello world!
-> no change

@dummdidumm dummdidumm added the bug label Jan 27, 2021
@tanhauhau
Copy link
Member

tanhauhau commented Jan 27, 2021

this is a regression caused by this: #5028

which was introduced in 3.24.0

the last version of this is working: https://svelte.dev/repl/05576047e43c40d38b1b8446dca313e1?version=3.23.2

@i1mT
Copy link
Author

i1mT commented Jan 27, 2021

this is a regression caused by this: #5028

which was introduced in 3.24.0

the last version of this is working: https://svelte.dev/repl/05576047e43c40d38b1b8446dca313e1?version=3.23.2

Nice!

@i1mT i1mT closed this as completed Jan 27, 2021
@dummdidumm dummdidumm reopened this Jan 27, 2021
@dummdidumm
Copy link
Member

Reopening so we can track it and close after it's fixed

@antony antony changed the title Repeat words in plain text doesn't reactive Repeat words in plain text isn't reactive Jan 27, 2021
@antony antony changed the title Repeat words in plain text isn't reactive Repeat words in plain text aren't reactive Jan 27, 2021
@i1mT
Copy link
Author

i1mT commented Jan 28, 2021

Reopening so we can track it and close after it's fixed

Oh, I misunderstood; I thought is was fixed, stupid haha

@i1mT
Copy link
Author

i1mT commented Mar 1, 2021

This issue: #5028

I think update TextNode should not compare wholeText, preprocess to contenteditable DOM is more reasonable.

@stale
Copy link

stale bot commented Jun 26, 2021

This issue 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.

@stale stale bot added the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 27, 2021
RaiVaibhav added a commit to RaiVaibhav/svelte that referenced this issue Oct 18, 2021
Fixes: sveltejs#5018
Fixes: sveltejs#5931

Issue caused because of setting the updated value to
the data property of moustache text node, use innerText if
parent have contenteditable attribute
@Conduitry
Copy link
Member

This should be fixed in 3.58.0 - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
@tanhauhau @dummdidumm @pngwn @i1mT @Conduitry and others