Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BriSeven/ad2e99a0874b7243b4cae3aae8cc2963 to your computer and use it in GitHub Desktop.
Save BriSeven/ad2e99a0874b7243b4cae3aae8cc2963 to your computer and use it in GitHub Desktop.
Disable dragging and selecting html elements (like links, images etc...) in Electron
/**
* 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