-
-
Save BriSeven/ad2e99a0874b7243b4cae3aae8cc2963 to your computer and use it in GitHub Desktop.
Disable dragging and selecting html elements (like links, images etc...) 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
/** | |
* MAKE ELECTRON APP FEEL MORE NATIVE | |
* | |
* * Prevent dragging all HTML elements, specially: | |
* - images | |
* - links (anchors) | |
* | |
* * Prevent text selection | |
*/ | |
*, *::after, *::before { | |
-webkit-user-select: none; | |
-webkit-user-drag: none; | |
-webkit-app-region: no-drag; | |
cursor: default; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment