DraxView's layout position is not updated when one of its prior sibling views changes size
See original GitHub issueI wasn’t able to use DraxList so I now have the following structure:
<DraxProvider>
<DraxScrollView>
<DraxView receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}>
<Text category="h5">Box 1</Text>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 1"/></DraxView>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 2"/></DraxView>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 3"/></DraxView>
</DraxView>
<DraxView receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}>
<Text category="h5">Box 2</Text>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 4"/></DraxView>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 5"/></DraxView>
<DraxView draggable={true} receptive={true} receivingStyle={styles.receiving} onReceiveDragDrop{...}><List Item style={styles.alphaItem} name="Item 6"/></DraxView>
</DraxView>
</DraxScrollView>
</DraxProvider>
Works mostly as expected. However, when I add or remove an Item within a Box, the next item I drag is not aligned with the cursor, i.e. shifted some amount down. It seems like measurement values are not updating properly after the height of the list changes. Is it possible to manually re-calculate offsets for where to position the drag view upon dragging an item? If not, any other suggestions?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Make child height update height of his siblings - Stack Overflow
I understand that you change the height/width of viewA programmatically. So you have the height and width resources available.
Read more >Mastering General Sibling Selectors: Custom Tab Navigation
Welcome to the next in our series of tutorials where we use the general sibling combinator ~ to create various components for the...
Read more >Adjacent sibling combinator - CSS: Cascading Style Sheets
The adjacent sibling combinator (+) separates two selectors and matches the second element only if it immediately follows the first element, ...
Read more >CSS Previous sibling selectors and how to fake them - Medium
Either parent selectors or previous siblings selectors are simply not a thing. ... “remember” the current rating, just in case the user wants...
Read more >The Adjacent-Sibling Selector - meyerweb.com
As previous articles in this series have shown, CSS has some interesting new selectors. Between the universal selector and the child selector, it's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Changing the key of the container worked! I’m not sure if this will be a noticeable performance difference, but it gets the job done for now. Thanks!
I’m sorry to hear that. It will probably be some time before I am able to dig in deeply on this code again and experiment. If anyone else has the availability, I’d be open to their findings.