Code Monkey home page Code Monkey logo

Comments (9)

isaacHagoel avatar isaacHagoel commented on July 19, 2024 4

Hi, I'm the maintainer of svelte-dnd-action. Based on

Confirmed this is due to delaying rerenders. The action updates its state in an update callback which is coming in too late for the other events, meaning that 5 items instead of 4 are inside the array, and that somehow messes with the each block.

This sounds like an issue with svelte that can affect other existing actions.

from svelte.

paoloricciuti avatar paoloricciuti commented on July 19, 2024 1

Mmm I think is rerunning the snapshot over and over since is in the template effect.

However if it's not necessary better since it's one distraction less. I'll try to take a look later

from svelte.

dummdidumm avatar dummdidumm commented on July 19, 2024 1

Confirmed this is due to delaying rerenders. The action updates its state in an update callback which is coming in too late for the other events, meaning that 5 items instead of 4 are inside the array, and that somehow messes with the each block.

from svelte.

paoloricciuti avatar paoloricciuti commented on July 19, 2024

$state.snapshot removes reactivity so you can't expect to use snapshot and still have reactivity

from svelte.

lts20050703 avatar lts20050703 commented on July 19, 2024

$state.snapshot removes reactivity so you can't expect to use snapshot and still have reactivity

@paoloricciuti Is it? I'm pretty sure that the HTML/Svelte code still "reference" the reactive state variable, because it still works when I downgrade to Svelte version @5.0.0-next.139 (repl: https://www.sveltelab.dev/ql0iefy6cbg81tq - the same as the repl above, only change is downgrade svelte to @5.0.0-next.139)

from svelte.

lts20050703 avatar lts20050703 commented on July 19, 2024

Okay so it turns out the $state.snapshot wasn't necessary, it was me trying to fix the error, I have updated the description and repl

from svelte.

paoloricciuti avatar paoloricciuti commented on July 19, 2024

Uh 140 Is the yield effects one. I have the feeling this is either something to fix in DnD itself or something really non obvious.

from svelte.

lts20050703 avatar lts20050703 commented on July 19, 2024

So is this a bug that Svelte need to fix or something that svelte-dnd-actions needs to fix?

from svelte.

dummdidumm avatar dummdidumm commented on July 19, 2024

Fixed by #11855, we reverted the event defer changes

from svelte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.