pmndrs / react-three-flex

💪📦 Flexbox for react-three-fiber
MIT License
1.65k stars 42 forks source link

Fix: box gets repositioned on props change #83

Closed chnicoloso closed 1 year ago

chnicoloso commented 1 year ago

Hi there!

I noticed that if I update the width of an element, it gets moved to the end of its parent: flex-width-bug

The issue seems to be that we're always inserting elements at the end, even when we're just updating the flexProps. Behavior with this change: flex-bug-fix

I'm not familiar with Yoga at all so I'm happy to close this in favor of a better fix if you have one!

Thanks!

chnicoloso commented 1 year ago

Hi @giulioz @talentlessguy, it seems like you're the main contributors but I can't request reviewers

duncanhsieh commented 1 year ago

I encountered the same problem, @giulioz @talentlessguy Do you have any suitable solutions?

talentlessguy commented 1 year ago

idk how to make me available for reviewer but I merged the PR, sorry for the wait

will publish a patch soon (2-3 days later)

chnicoloso commented 1 year ago

Thanks @talentlessguy! And thank you @duncanhsieh for pinging 😄

chnicoloso commented 1 year ago

@talentlessguy do you know when the merged changes might make it to a release build? I might be missing something but I don't see a new version available 🤔

chnicoloso commented 1 year ago

Ah nvm, there's not a new tag here on the repo but I see the new release on npm (1.0.1) - thanks!