tomkp / react-split-pane

React split-pane component
https://tomkp.github.io/react-split-pane
MIT License
3.21k stars 408 forks source link

fix iframe - mouse event while dragging #761

Open sytolk opened 3 years ago

Vadim-1507 commented 1 year ago

Hi! You can fix this problem with external library API, example code:

.split_conteiner {
    position: relative
    ...
}
.mouse_blocker {
    width: 100%;
    height: 100%';
    position: absolute;
    z-index: 100;
    opacity: 0;
}

function SplitPaneBlock (props: SomeProps) {
    const [active, setActive] = React.useState<boolean>(false);
    const onStartHandler = () => { setActive(true); }
    const onFinishedHandler = () => { setActive(false); }

    return (
        <div className="split_conteiner"> 
            {active && (<div className="mouse_blocker"/>)}
            <SplitPane
                ...
                onDragStarted={onStartHandler}
                onDragFinished={onFinishedHandler}
            >
                ...
            </SplitPane>
        </div>
    )
}

It`s work for me