learn.svelte.dev icon indicating copy to clipboard operation
learn.svelte.dev copied to clipboard

fix(svelt:events): ensure m prop is synced

Open pedroyremolo opened this issue 1 year ago • 2 comments

Description

After solving the tutorial exercise of section Part 1. BasicSvelt > Events > DOM Events as requested by the tutorial, the pointer position was not being updated at the DOM. This was happening because the m object was not being assigned after changes, this PR solved it.

Disclaim: Opted for m = m; instead of whole object assignment because the next section already suggests it

pedroyremolo avatar Feb 17 '24 18:02 pedroyremolo

@pedroyremolo is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 17 '24 18:02 vercel[bot]

This isn't necessary. Assigning to m.x or m.y already invalidates m. The text updates when you just add the on:pointermove={handleMove}. What are you seeing?

Conduitry avatar Feb 17 '24 18:02 Conduitry

You're right mate, don't remember the scenario anymore but the rendering was not happening unless I forcefully the m = m change.

But since I cannot simulate the issue anymore, all good in the neighborhood. Thanks for the support

pedroyremolo avatar Jun 12 '24 19:06 pedroyremolo