-
-
Save asadadams/8ee6590619b1cac629dee76a0a2ceac4 to your computer and use it in GitHub Desktop.
Disable selection/highlighting and element draggin in Electron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* disable selection */ | |
:not(input):not(textarea), | |
:not(input):not(textarea)::after, | |
:not(input):not(textarea)::before { | |
-webkit-user-select: none; | |
user-select: none; | |
cursor: default; | |
} | |
input, button, textarea, :focus { | |
outline: none; | |
} | |
/* disable image and anchor dragging */ | |
a:not([draggable=true]), img:not([draggable=true]) { | |
-webkit-user-drag: none; | |
user-drag: none; | |
} | |
a[href^="http://"], | |
a[href^="https://"], | |
a[href^="ftp://"] { | |
-webkit-user-drag: auto; | |
user-drag: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment