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

Partially out-of-view window jumps and changes position when handle is touched #742

Open
HenrikBechmann opened this issue Mar 16, 2024 · 0 comments

Comments

@HenrikBechmann
Copy link

HenrikBechmann commented Mar 16, 2024

Hi, I'm making a windowing system (for which, thanks for your utility).

But there's something odd. When I click on the title (which is the handle) of the pictured window, then it jumps fully into view (by scrolling the parent), and also changes its top/left co-ordinates (moving it away from its peers).

I've had to compensate by adding the following code to the onStop method (note the reversal of the deltaY values, and the counter-scroll operation):

const onDragStop = (e, data) => {

        if (data.deltaY) {
            panelFrameElementRef.current.scrollTop -= data.deltaY
        }

        setWindowConfigSpecs((oldState) => {
            return {...oldState, top:data.y - data.deltaY, left: data.x}
        })

}

Any suggestions?

Screenshot 2024-03-16 at 8 19 15 AM
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