Skip to content
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

Drax measurement system completely brakes when items resize #179

Open
ofersadgat opened this issue Nov 20, 2024 · 2 comments
Open

Drax measurement system completely brakes when items resize #179

ofersadgat opened this issue Nov 20, 2024 · 2 comments

Comments

@ofersadgat
Copy link

ofersadgat commented Nov 20, 2024

If you have a list:

function resizingText(props){
   const [height, setHeight] = useState(20);
   useEffect(() => {
       const t = setTimeout(() => {
          setHeight(40);
       }, 1000);
       return () => clearTimeout(t);
   });
   return <View height={height}><Text>{props.children}</View>;
}

function renderList(){
  return (
     <>
      <DraxView><Text>1<Text></DraxView>
      <DraxView><resizingText>2<resizingText></DraxView>
      <DraxView><Text>3<Text></DraxView>
      <DraxView><Text>4<Text></DraxView>
     </>
  )
}

in the above case, drax will detect and correctly update the resize and positioning of the resizingText but what fails is that the position of the elements after (text 3 and text 4) have changed due to being positioned relatively, but Drax fails to update their locations causing drag/drop to fail. The current algorithm is to look up the tree on change, but I think it also needs to look at siblings. Thoughts?

@LunatiqueCoder
Copy link

Hey @ofersadgat. Could #112 be related? I think it might be a duplicate actually.

@ofersadgat
Copy link
Author

That thread seems to be talking about absolutely positioned elements, this one is about relative positioned elements. Unless you're saying that drax will convert relative positioning to absolute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants