Giter Club home page Giter Club logo

Comments (5)

mpearson avatar mpearson commented on July 17, 2024 1

Awesome, thanks for the quick turnaround! Was really excited about using this library caus it's great. Glad the solution didn't end up being too complicated.

from dockview.

mpearson avatar mpearson commented on July 17, 2024

Good news! I think I found a workaround. I noticed when getting stuck in drag mode, I could see the title of one of the panels very faintly, moving around with the mouse:

Image2

This made me think the entire panel element was being dragged. I added the following CSS rule and have been unable to recreate the bug since. Note that both selectors seem to be required, otherwise it occasionally reproduces, so I guess both of these elements are sometimes getting selected.

.split-view-container .view-container .view, .groupview {
  user-select: none;
}

from dockview.

mpearson avatar mpearson commented on July 17, 2024

Realized that the previous CSS rule was breaking all text selection inside the panel, which is obviously not ideal. Worse, re-enabling user-select: auto on any child element seemed to break the whole thing and the bug came back. Finally I figured out that it just needs to be applied to the drag handles themselves:

.split-view-container .sash-container .sash {
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE 10 and IE 11 */
}

This appears to fix the bug as well as preserve normal selection of panel content.

from dockview.

mathuo avatar mathuo commented on July 17, 2024

Thanks for the detailed description and the attempt to fix it too!

I just checked this out by adding a global drag listener to check what was actually being dragged here, something like:

document.addEventListener('dragStart', (e) => {
    console.log('drag', e)
});

and yes it seems that the sash element is unintentionally entering a drag state occasionally as below. I think your analysis and fix is correct, great spot.

screenshot

I will double-check a few things and aim to merge your PR and publish a fix version for this in the next day or two.

Thanks for finding the bug and the fix🙂

from dockview.

mathuo avatar mathuo commented on July 17, 2024

This is now merged and published as v1.7.2

from dockview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.