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

react-native-web

Package Overview
Dependencies
Maintainers
1
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-web - npm Package Compare versions

Comparing version 0.19.8 to 0.19.9

34

dist/cjs/exports/TextInput/index.js

@@ -185,2 +185,10 @@ "use strict";

var hostRef = React.useRef(null);
var prevSelection = React.useRef(null);
var prevSecureTextEntry = React.useRef(false);
React.useEffect(() => {
if (hostRef.current && prevSelection.current) {
setSelection(hostRef.current, prevSelection.current);
}
prevSecureTextEntry.current = secureTextEntry;
}, [secureTextEntry]);
var handleContentSizeChange = React.useCallback(hostNode => {

@@ -289,15 +297,19 @@ if (multiline && onContentSizeChange && hostNode != null) {

function handleSelectionChange(e) {
if (onSelectionChange) {
try {
var node = e.target;
var selectionStart = node.selectionStart,
selectionEnd = node.selectionEnd;
e.nativeEvent.selection = {
start: selectionStart,
end: selectionEnd
};
try {
var _e$target = e.target,
selectionStart = _e$target.selectionStart,
selectionEnd = _e$target.selectionEnd;
var _selection = {
start: selectionStart,
end: selectionEnd
};
if (onSelectionChange) {
e.nativeEvent.selection = _selection;
e.nativeEvent.text = e.target.value;
onSelectionChange(e);
} catch (e) {}
}
}
if (prevSecureTextEntry.current === secureTextEntry) {
prevSelection.current = _selection;
}
} catch (e) {}
}

@@ -304,0 +316,0 @@ (0, _useLayoutEffect.default)(() => {

@@ -180,2 +180,10 @@ /**

var hostRef = React.useRef(null);
var prevSelection = React.useRef(null);
var prevSecureTextEntry = React.useRef(false);
React.useEffect(() => {
if (hostRef.current && prevSelection.current) {
setSelection(hostRef.current, prevSelection.current);
}
prevSecureTextEntry.current = secureTextEntry;
}, [secureTextEntry]);
var handleContentSizeChange = React.useCallback(hostNode => {

@@ -284,15 +292,19 @@ if (multiline && onContentSizeChange && hostNode != null) {

function handleSelectionChange(e) {
if (onSelectionChange) {
try {
var node = e.target;
var selectionStart = node.selectionStart,
selectionEnd = node.selectionEnd;
e.nativeEvent.selection = {
start: selectionStart,
end: selectionEnd
};
try {
var _e$target = e.target,
selectionStart = _e$target.selectionStart,
selectionEnd = _e$target.selectionEnd;
var _selection = {
start: selectionStart,
end: selectionEnd
};
if (onSelectionChange) {
e.nativeEvent.selection = _selection;
e.nativeEvent.text = e.target.value;
onSelectionChange(e);
} catch (e) {}
}
}
if (prevSecureTextEntry.current === secureTextEntry) {
prevSelection.current = _selection;
}
} catch (e) {}
}

@@ -299,0 +311,0 @@ useLayoutEffect(() => {

@@ -6,3 +6,3 @@ {

"name": "react-native-web",
"version": "0.19.8",
"version": "0.19.9",
"description": "React Native for Web",

@@ -9,0 +9,0 @@ "module": "dist/index.js",

@@ -196,3 +196,12 @@ /**

const hostRef = React.useRef(null);
const prevSelection = React.useRef(null);
const prevSecureTextEntry = React.useRef(false);
React.useEffect(() => {
if (hostRef.current && prevSelection.current) {
setSelection(hostRef.current, prevSelection.current);
}
prevSecureTextEntry.current = secureTextEntry;
}, [secureTextEntry]);
const handleContentSizeChange = React.useCallback(

@@ -328,14 +337,17 @@ (hostNode) => {

function handleSelectionChange(e) {
if (onSelectionChange) {
try {
const node = e.target;
const { selectionStart, selectionEnd } = node;
e.nativeEvent.selection = {
start: selectionStart,
end: selectionEnd
};
try {
const { selectionStart, selectionEnd } = e.target;
const selection = {
start: selectionStart,
end: selectionEnd
};
if (onSelectionChange) {
e.nativeEvent.selection = selection;
e.nativeEvent.text = e.target.value;
onSelectionChange(e);
} catch (e) {}
}
}
if (prevSecureTextEntry.current === secureTextEntry) {
prevSelection.current = selection;
}
} catch (e) {}
}

@@ -342,0 +354,0 @@

Sorry, the diff of this file is not supported yet

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