Jump to content
Search Community

Draggable blips around when using pub/sub

mallanaga test
Moderator Tag

Recommended Posts

card_blip.gif.dbbda3a89b55986716e73eb945ddcdda.gif

 

Hello there! I'm not entirely sure this has anything to do with gsap, but I don't know who else to ask. I'm working on an app to play cards, and broadcasting events. I won't bore you with those details. I use Draggable with the onDrag listener, then broadcasting the draggable's style.transform

 

I pick up the changes with this: 

eventSource.addEventListener("cardPosition", (e) => {
  const data = JSON.parse(e.data),
  target = document.getElementById(data.message.id);
  target.style.transform = data.message.transform;
});

This works, but the dom seems to be confused about the position of the element when grabbing it from another client. Attached is a gif showing an example. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...