Regression in 1.3.2: splitter snaps back to initial size on child change
See original GitHub issueConsider the following example:
import Splitter from "@devbookhq/splitter";
import { useState, useCallback } from "react";
function MyComponent() {
const [count, setCount] = useState(0);
const handleClick = useCallback(() => setCount(count + 1), [count]);
return (
<Splitter>
<div onClick={handleClick}>Click me</div>
<div>{count}</div>
</Splitter>
);
}
Background
A component which renders a splitter with two children. The component has a state - a counter. When the user clicks the first child of the splitter, the counter is incremented. The second child of the splitter renders the counter.
Reproduction steps
- After the component is rendered, grab the splitter and move it to a new location
- Click on the “Click me” child of the splitter
Observed behavior with splitter 1.3.2
The splitter snaps back to its initial location and the counter rendered in the second child goes up.
Observed behavior with 1.2.4
The splitter maintains its current position and the counter rendered in the second child goes up.
I believe the issue is caused by this: https://github.com/DevbookHQ/splitter/blob/master/src/index.tsx#L358
The useEffect hook is called whenever the children of the splitter change, which leads to the splitter snapping back to its initial location.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Issues · devbookhq/splitter - GitHub
Total percentage of column sizes passed to onResizeFinished is more than 100% ... Regression in 1.3.2: splitter snaps back to initial size on...
Read more >Untitled
7x9 beige area rug, Net cash flow vs net income, Sunday's child is full of grace rhymes, Coc in pc download, 1 350...
Read more >bHf - River Thames Conditions - Environment Agency - GOV.UK
Come back my love chords darts, Alternative to skype screen sharing, Working together as a team wow, Vietnamese sandwich san jose, E-center bad...
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:45 - "colorgcc-1.3.2.ebuild violates CONFIG_PROTECT" status:RESOLVED ... with a trace back error" status:RESOLVED resolution:FIXED severity:normal ...
Read more >Flex UI Release Notes for v1.x.x - Twilio
Degraded mode - now Flex UI will initialize with limited capabilities, ... Vertical TaskCanvas minimum size reduced to allow splitter interaction on small ......
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 FreeTop 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
Top GitHub Comments
Thank you. I’ll try to implement this into the next release.