Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toggle-selection

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toggle-selection

Toggle current selected content in browser

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is toggle-selection?

The toggle-selection npm package is designed to enable and disable text selection on web pages. It provides a simple API to programmatically control the user's ability to select text within the document, which can be useful in various user interface scenarios where text selection might interfere with other interactions or where it needs to be controlled for security or aesthetic reasons.

What are toggle-selection's main functionalities?

Disable text selection

This feature allows developers to disable text selection on the entire web page. It is useful in scenarios where text selection could interfere with drag-and-drop interactions or other UI elements.

const toggleSelection = require('toggle-selection');

function disableSelection() {
  toggleSelection.disable();
}

Enable text selection

This feature allows developers to re-enable text selection if it has been previously disabled. This is useful for toggling text selection dynamically based on certain user actions or application states.

const toggleSelection = require('toggle-selection');

function enableSelection() {
  toggleSelection.enable();
}
0

Keywords

FAQs

Package last updated on 24 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc