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

Percentage total of a pair is not respected while dragging if more than 2 children are passed to Splitter #15

Open
chiragA17 opened this issue Mar 24, 2022 · 0 comments

Comments

@chiragA17
Copy link

chiragA17 commented Mar 24, 2022

Hi

Use Case

I'm using the Splitter to show multiple devices stacked next to each other in a resizable fashion. I'm passing initialSizes to the Splitter to persist the size change in case of re-renders by saving the size array obtained from onResizeFinished event handler.

Problem

If you notice in the elements tab of dev tools, whenever I start dragging a gutter the pair that is involved in the operation loses the percentage sum of that pair which results in the bouncing nature of the other panes in the splitter.

My understanding

I'm attaching a video for reference here. In this video, you'll notice that when I start dragging the first gutter before drag starts the sum of percentage for the pair is (20.98 + 28.35) 49.33%. Now, as soon as I start the drag operation the sum of the percentage of the pair goes above this value (for instance at 0:02 in the video, the values are 36.92 & 29.746 which adds up to 66.66%). Similarly, sometimes it goes below the actual sum in which case you'll notice a whitesmoke colored background after the 3rd device (which shows how the sum of the three panes is not actually 100% but much lower than that.

SplitterIssueRecording2.mov

Although I have handled this issue when the drag ends by calculating the percentage change in one item of the pair. Although, I want to fix this flakiness while dragging.

Unfortunately, I cannot share any code snippets here but I've added a code sandbox to reproduce this. If you can suggest any possible solutions that I could implement at the earliest that would be great.

Sandbox Link:
https://codesandbox.io/embed/devbookhq-spliiter-example-forked-8is0vz?fontsize=14&hidenavigation=1&theme=dark

@chiragA17 chiragA17 changed the title Percntage total of a pair is not respected while dragging if more than 2 children are passed to Splitter Percentage total of a pair is not respected while dragging if more than 2 children are passed to Splitter Mar 24, 2022
foxriver76 added a commit to ioBroker/ioBroker.vis-2 that referenced this issue Jan 9, 2024
foxriver76 added a commit to ioBroker/ioBroker.vis-2 that referenced this issue Jan 9, 2024
* fixed issues with BulkEdtior (dialog not closing and other dialog showing wrong button)

- closes #296

* formatting

* implemented workaround resize bug for devbookhq/splitter#15

- closes #282

---------

Signed-off-by: Max Hauser <[email protected]>
foxriver76 added a commit to ioBroker/ioBroker.vis-2 that referenced this issue Jan 9, 2024
* (foxriver76) fixed last change y-offset for some widgets
* (foxriver76) fixed issue where JquiState did not respect data type
* (foxriver76) fixed issues with BulkEdtior (dialog not closing and other dialog showing wrong button)
* (foxriver76) implemented workaround resize bug for devbookhq/splitter#15
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

1 participant