Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add option to prevent accidentally moving folder #835

Closed

Description

@miftahafina

Please add option to prevent accidentally move folder with drag-n-drop, especially for 'careless' programmer like me.

Activity

  1. thomasjo commented on May 15, 2016

    @thomasjo
    Contributor

    What would such a feature be? I'm not aware of any IDE (or other relevant software for that matter) with any special "feature" to prevent accidentally moving folders when dragging and dropping.

  2. miftahafina commented on May 15, 2016

    @miftahafina
    Author

    Sorry, I mean 'option', not 'feature'.

  3. changed the title [-]Add feature to prevent accidentally move folder[/-] [+]Add option to prevent accidentally move folder[/+] on May 15, 2016
  4. thomasjo commented on May 15, 2016

    @thomasjo
    Contributor

    Just to be sure we're on the same page; you want an option to disable the drag and drop feature entirely?

  5. miftahafina commented on May 15, 2016

    @miftahafina
    Author

    Yes, I want it.
    But of course, I wish the 'drag-n-drop' is enabled by default.

  6. thomasjo commented on May 15, 2016

    @thomasjo
    Contributor

    @atom/feedback What do we think about this? In general I'm against adding functionality like this. We definitely don't need more checkboxes for tiny stuff like this.

    I'm fairly sure we can find a way to kill the drag and drop functionality via the init script (or perhaps via style tweaking)... I propose we find such a workaround and close this as wontfix.

  7. lee-dohm commented on May 16, 2016

    @lee-dohm
    Contributor

    I'd be open to making it harder to accidentally drag and drop things if we had an example of a situation that caused an accidental drag action. I think the best solution is to make drag and drop require a very deliberate action and make it very visible.

    @miftahafina do you have an example of a situation that caused an accidental drag-and-drop action that we can reproduce?

  8. miftahafina commented on May 17, 2016

    @miftahafina
    Author

    For example when I use laptop without 2 fingers gesture to scroll, so I have to press the left click button (or double tap the touchpad) and drag the scrollbar manually. But, sometime I move the file into other folder accidentally.

  9. lee-dohm commented on May 17, 2016

    @lee-dohm
    Contributor

    I feel like the answer to that is to make the scroll bar bigger when you're in that situation so that it isn't as easy to miss.

    @simurai do you have any suggestions for how to do that? Is there a way to make the scroll bar grow on hover?

  10. BinaryMuse commented on May 17, 2016

    @BinaryMuse

    I'm in agreement that more checkboxes isn't the right approach here. In addition to @lee-dohm's suggestion, perhaps we can maintain an operation history so you can "undo" in the tree view easily

  11. simurai commented on May 18, 2016

    @simurai
    Contributor

    make the scroll bar bigger

    Adding the following to styles.less should work. But on OS X only if you enable "Show scroll bars: Always".

    .scrollbars-visible-always .tree-view-scroller::-webkit-scrollbar {
      width: 20px;
    }

    I'm fairly sure we can find a way to kill the drag and drop functionality via the init script (or perhaps via style tweaking)

    You should be able to disable dragging with:

    .tree-view [draggable="true"] {
      -webkit-user-drag: none;
    }

    It might could be combined with an init script to temporarily enable dragging by pressing cmd or so. Then you'd still be able to drag, just not as easy.

  12. changed the title [-]Add option to prevent accidentally move folder[/-] [+]Add option to prevent accidentally moving folder[/+] on May 18, 2016
  13. lee-dohm commented on May 19, 2016

    @lee-dohm
    Contributor

    Thanks so much for the solution @simurai 😀 Since dragging can be disabled by a simple styles.less change, I'm going to close this.

  14. cstockton commented on Oct 22, 2016

    @cstockton

    @simurai I know this is an old issue, but I was just about ready to flip my desk over this time. I have developed a paranoia for these "instant drags" that occur sometimes without me really noticing. Sometimes I'll see a glimpse of the handle and not be sure if anything actually moved or not.. and end up having to sort through a rsync dry run against my backup partitions to be sure I didn't delete anything. Then just now I saw a popup saying "Cross device copying is not supported" in a little "instant drag" and I decided I was going to solve this once and for all, even if it meant writing a plugin or drinking myself into a coma. After digging around I came across this thread, before my drag and drop insanity got too out of hand.

    Those three glorious lines of CSS are fantastic and I thank you sir.

  15. kennblvnp commented on Nov 9, 2018

    @kennblvnp

    Hi @simurai ! What are the exact steps to do this??

  16. rsese commented on Nov 9, 2018

    @rsese

    @kennblvnp - the steps @simurai mentioned are macOS specific and still seem to work (I just tried it out):

    1. From the command palette run Application: Open Your Stylesheet
    2. Add and save the CSS @simurai mentioned above:
    .tree-view [draggable="true"] {
      -webkit-user-drag: none;
    }

    As also mentioned, on macOS you need to have System Preferences > General > Show Scroll Bars set to Always for this to work.

    If you have any trouble, please reach out on the message board or the Atom Slack.

  17. kennblvnp commented on Nov 10, 2018

    @kennblvnp

    @rsese thank you very much! but im using windows...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions