react-split-pane icon indicating copy to clipboard operation
react-split-pane copied to clipboard

Weird behavior while resizing when one of the panes is an iframe

Open hhvys opened this issue 5 years ago • 6 comments

Describe the bug

Weird behavior while resizing when one of the panes is an iframe

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/upbeat-morning-94qr7
  2. Try to resize panes

Expected behavior

Should be able to resize as usual

Additional context

Try rendering anything other than an iframe. I think the problem here is Mouse events are not being captured by the window in which SplitPane is defined. Instead, iframe itself is capturing the mouse event.

hhvys avatar Sep 25 '19 17:09 hhvys

Possible solution

  • When SplitPane is resizing a wrapper with 100% height and 100% width can be created on top of the panes. Doing this will prevent iframe from capting mouse events.
  • Instead of doing this each time some prop e.g. disablePointer can be exposed. Which ensures that a wrapper is created on top of both the panes

hhvys avatar Sep 25 '19 17:09 hhvys

I created a relatively simple fix that keys off the "active" state of the pane

https://github.com/quarkw/react-split-pane/commit/bd1f68ac9ee89a09b7086fbb70065a9457ae44f0

quarkw avatar Oct 09 '19 06:10 quarkw

Added 'opacity: 0' to the overlay in case the user has custom styling on div's. It may help a bit with performance too, since the browser doesn't have to render anything (but still needs to track mouse events)

https://github.com/quarkw/react-split-pane/commit/96dc6a0d666e663a9d96355a75162d59cf4a696e

quarkw avatar Oct 09 '19 16:10 quarkw

Any solution for this issue ??

AravindTReddy avatar Oct 19 '20 16:10 AravindTReddy

This is a duplicate of https://github.com/tomkp/react-split-pane/issues/30. The other issue also contains a proposal for a workaround.

ubmarco avatar Oct 21 '20 05:10 ubmarco

I tried the work around but it's not helpful.

AravindTReddy avatar Oct 22 '20 01:10 AravindTReddy