-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix: TresGroup components emit children mesh events #439
Conversation
✅ Deploy Preview for tresjs-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… we check if an object isGroup. If it is, we run through it's children and set their event listeners as the parents. If the child already has event listeners wired up, then we combine the functions
Hey buddy @garrlker any update on this one? |
@alvarosabu just saw your comment. I sent you a DM about this but for anyone else seeing this post I've been working on a different approach and I'm hoping to push those changes later this week. It's looking to be much simpler, require less type changes, "just work" TM, and also match "convention" to Vue's native event bubbling. The current solution that is pushed up was more convoluted to support than I expected plus @Tinoooo found some issues with it that could be difficult to work around. |
…son about and aligns more closely to how a user would expect this to work
@garrlker I finally found some time to check out your PR. Sorry for the huge delay. I have three topics I want to discuss. 1️⃣ Parent elements (the group) only receive events if the child element has event listeners attached to them. I know that Threlte and R3F work this way, but I think this behavior is not quite intuitive to users. But this might be just me. On the other side I don't have a better solution in mind, so maybe the behavior is the way to go. 2️⃣ Using 3️⃣ This should work with primitives (like shown here) too. Both topics require us to first define how the event handling/bubbling should work. What are you opinions about this @garrlker @alvarosabu @JaimeTorrealba? If this discussion requires extensive time, we could schedule a call to address it. small update: |
Hi, @Tinoooo thanks for jumping in, and thanks both @garrlker for taking care of this one. I have done benchmarking and created a simple app on the 3 major renderers to check the differences between them and understand the problem (without taking this PR into consideration): R3F and Threlte share the most similarities, especially on the event topic vs Tres. This is not necessarily a bad thing but I think we should agree and maybe ask the community what behavior they are expecting to decide if its a bug. With that being said I think its an area with a lot of room for improvement. I'm up for a pair programming session together if you like! We can do it on discord on the after-work channel or even a bug-hunting stream on Twitch, as you prefer. Let me know what do you think |
@garrlker quick small feedback:
|
@Tinoooo thank you for diving into this so thoroughly. I missed those cases 100% agree on us clearly defining how this should work and asking the community. We can still implement it in a more Vue-ish way, Ex. we should have @alvarosabu Gotcha, ty for the tips I'm also down for a call and/or pair programming to get this finished |
Closing for #515 Will continue work there |
Not quite done yet. It works, but only for children components that also have event handlers wired onto them.
It's seems to be ignoring the rest of the children.
Also random but it seems like mouse events are firing off sporadically?
I'm including TheExperience bug recreation from the issue for now, but will remove it before merge