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

fix: Support iframe while dragging

Open nvh95 opened this issue 4 years ago • 3 comments

Fix #30 #241 #361 If a pane contains an iframe, it behaves very weirdly while dragging the resizer. There are some workarounds like https://github.com/tomkp/react-split-pane/issues/30#issuecomment-169309414 https://github.com/tomkp/react-split-pane/issues/30#issuecomment-278774489 https://github.com/tomkp/react-split-pane/issues/241#issuecomment-451708777 but I think it's better if the library handles this issue itself.

I did give a comment here: https://github.com/tomkp/react-split-pane/issues/241#issuecomment-677091968

Let me know if this fix is good. Thank you. cc: @tomkp @wuweiweiwu

nvh95 avatar Aug 22 '20 04:08 nvh95

Anyone planning to approve this change?

Spiderpig86 avatar Oct 04 '20 07:10 Spiderpig86

I tested this, it doesn't solve the issue when iframe is not an immediate child. This PR helped me find another solution however.

I made this change in the library:

const pane1Classes = ['Pane1', paneClassName, pane1ClassName, active ? 'split-pane-active' : ''].join(' ');
const pane2Classes = ['Pane2', paneClassName, pane2ClassName, active ? 'split-pane-active' : ''].join(' ');

And then in my own app:

.split-pane-active iframe {
  pointer-events: none;
}

Adding a class name can be helpful for other use-cases as well.

@wuweiweiwu @tomkp

shakiba avatar Feb 28 '21 09:02 shakiba

I think this is better fix for this issue: https://github.com/tomkp/react-split-pane/pull/761

sytolk avatar May 14 '21 07:05 sytolk