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

text-field-edit

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-field-edit - npm Package Compare versions

Comparing version 3.1.2022 to 3.1.9001

9

index.js

@@ -0,1 +1,8 @@

// https://github.com/fregante/text-field-edit/issues/16
function safeTextInsert(text) {
if (text === '') {
return document.execCommand('delete');
}
return document.execCommand('insertText', false, text);
}
function insertTextFirefox(field, text) {

@@ -16,3 +23,3 @@ // Found on https://www.everythingfrontend.com/posts/insert-text-into-textarea-at-cursor-position.html 🎈

}
if (!document.execCommand('insertText', false, text)) {
if (!safeTextInsert(text)) {
insertTextFirefox(field, text);

@@ -19,0 +26,0 @@ }

2

package.json
{
"name": "text-field-edit",
"version": "3.1.2022",
"version": "3.1.9001",
"description": "Insert text in a `<textarea>` and `<input>` (including Undo in most browsers)",

@@ -5,0 +5,0 @@ "keywords": [

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