🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@wordpress/dom

Package Overview
Dependencies
Maintainers
8
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/dom - npm Package Compare versions

Comparing version

to
2.0.3

20

build-module/dom.js

@@ -428,6 +428,18 @@ /**

export function isTextField(element) {
var nodeName = element.nodeName,
selectionStart = element.selectionStart,
contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
try {
var nodeName = element.nodeName,
selectionStart = element.selectionStart,
contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
} catch (error) {
// Safari throws an exception when trying to get `selectionStart`
// on non-text <input> elements (which, understandably, don't
// have the text selection API). We catch this via a try/catch
// block, as opposed to a more explicit check of the element's
// input types, because of Safari's non-standard behavior. This
// also means we don't have to worry about the list of input
// types that support `selectionStart` changing as the HTML spec
// evolves over time.
return false;
}
}

@@ -434,0 +446,0 @@ /**

@@ -457,6 +457,18 @@ "use strict";

function isTextField(element) {
var nodeName = element.nodeName,
selectionStart = element.selectionStart,
contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
try {
var nodeName = element.nodeName,
selectionStart = element.selectionStart,
contentEditable = element.contentEditable;
return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true';
} catch (error) {
// Safari throws an exception when trying to get `selectionStart`
// on non-text <input> elements (which, understandably, don't
// have the text selection API). We catch this via a try/catch
// block, as opposed to a more explicit check of the element's
// input types, because of Safari's non-standard behavior. This
// also means we don't have to worry about the list of input
// types that support `selectionStart` changing as the HTML spec
// evolves over time.
return false;
}
}

@@ -463,0 +475,0 @@ /**

4

package.json
{
"name": "@wordpress/dom",
"version": "2.0.2",
"version": "2.0.3",
"description": "DOM utilities module for WordPress.",

@@ -29,3 +29,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "0aa5c4340f57a69ab935f9e819d74958aad2e022"
"gitHead": "ce02ee2a1749b9b5564cb8483f6c8f24cf8a3871"
}

@@ -436,9 +436,21 @@ /**

export function isTextField( element ) {
const { nodeName, selectionStart, contentEditable } = element;
try {
const { nodeName, selectionStart, contentEditable } = element;
return (
( nodeName === 'INPUT' && selectionStart !== null ) ||
( nodeName === 'TEXTAREA' ) ||
contentEditable === 'true'
);
return (
( nodeName === 'INPUT' && selectionStart !== null ) ||
( nodeName === 'TEXTAREA' ) ||
contentEditable === 'true'
);
} catch ( error ) {
// Safari throws an exception when trying to get `selectionStart`
// on non-text <input> elements (which, understandably, don't
// have the text selection API). We catch this via a try/catch
// block, as opposed to a more explicit check of the element's
// input types, because of Safari's non-standard behavior. This
// also means we don't have to worry about the list of input
// types that support `selectionStart` changing as the HTML spec
// evolves over time.
return false;
}
}

@@ -445,0 +457,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet