Node bound to object property fails when the property in the object is deleted.
See original GitHub issueDescribe the bug See the title above. For instance the code below fails when the button is clicked.
<script>
let items = [
{number: 1, node: null}
];
</script>
<p bind:this={items[0].node}>
{items[0].number}
</p>
<button on:click={()=>items = []}>Delete</button>
There multiple ways the above pattern fails outlined in the REPL below. However, they’re all in the same class of bugs. https://svelte.dev/repl/96355b3f8a45421086f3a4dd0a7163f5?version=3.12.1
Ingore the fact that there are two “App.svelte” files in the REPL above. The code’s the same in both. It’s related to a REPL bug that I’ll file in a separate issue in a bit.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Javascript delete object property not working - Stack Overflow
If the object inherits a property from a prototype, and doesn't have the property itself, the property can't be deleted by referencing the...
Read more >delete operator - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a property from an object. If the property's value is an object and there are no more references to...
Read more >deleting object properties doesn't trigger a render · Issue #3211
values = Object.values(obj) is not reactive for a delete #3839. Closed. Node bound to object property fails when the property in the object...
Read more >Error When Deleting Associated Node Properties "Cannot ...
Error When Deleting Associated Node Properties "Cannot delete the property Department. It is still referenced by a node type or viewpoint" ...
Read more >Learn JavaScript: Objects Cheatsheet - Codecademy
New properties can be added, and existing property values can be changed or deleted. It is the reference to the object, bound to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think #3211 was the first place it came up.
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.