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

@mirohq/design-system-use-press

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mirohq/design-system-use-press - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

20

dist/main.js

@@ -183,3 +183,3 @@ 'use strict';

if (state.isPressed && state.target != null && isValidKeyboardEvent(e, state.target)) {
if (shouldPreventDefaultKeyboard(e.target, e.key)) {
if (shouldPreventDefaultKeyboard(e.target)) {
e.preventDefault();

@@ -209,9 +209,9 @@ }

}
if (e.repeat) {
return;
}
if (isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && e.currentTarget.contains(e.target)) {
if (shouldPreventDefaultKeyboard(e.target, e.key)) {
if (shouldPreventDefaultKeyboard(e.target)) {
e.preventDefault();
}
if (e.repeat) {
return;
}
handleFocus({

@@ -257,11 +257,3 @@ target: e.currentTarget,

]);
const shouldPreventDefaultKeyboard = (target, key) => {
if (target instanceof HTMLInputElement) {
return !isValidInputKey(target, key);
}
if (target instanceof HTMLButtonElement) {
return target.type !== "submit";
}
return true;
};
const shouldPreventDefaultKeyboard = (target) => !(target instanceof HTMLInputElement || target instanceof HTMLButtonElement);
const isHTMLAnchorLink = (target) => target.tagName === "A" && target.hasAttribute("href");

@@ -268,0 +260,0 @@ const isValidInputKey = (target, key) => (

@@ -179,3 +179,3 @@ import { useRef, useState, useEffect } from 'react';

if (state.isPressed && state.target != null && isValidKeyboardEvent(e, state.target)) {
if (shouldPreventDefaultKeyboard(e.target, e.key)) {
if (shouldPreventDefaultKeyboard(e.target)) {
e.preventDefault();

@@ -205,9 +205,9 @@ }

}
if (e.repeat) {
return;
}
if (isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && e.currentTarget.contains(e.target)) {
if (shouldPreventDefaultKeyboard(e.target, e.key)) {
if (shouldPreventDefaultKeyboard(e.target)) {
e.preventDefault();
}
if (e.repeat) {
return;
}
handleFocus({

@@ -253,11 +253,3 @@ target: e.currentTarget,

]);
const shouldPreventDefaultKeyboard = (target, key) => {
if (target instanceof HTMLInputElement) {
return !isValidInputKey(target, key);
}
if (target instanceof HTMLButtonElement) {
return target.type !== "submit";
}
return true;
};
const shouldPreventDefaultKeyboard = (target) => !(target instanceof HTMLInputElement || target instanceof HTMLButtonElement);
const isHTMLAnchorLink = (target) => target.tagName === "A" && target.hasAttribute("href");

@@ -264,0 +256,0 @@ const isValidInputKey = (target, key) => (

{
"name": "@mirohq/design-system-use-press",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -30,4 +30,4 @@ "author": "Miro",

"@mirohq/design-system-use-listeners": "^0.1.1",
"@mirohq/design-system-utils": "^0.14.3",
"@mirohq/design-system-use-logger": "^0.1.5"
"@mirohq/design-system-use-logger": "^0.1.5",
"@mirohq/design-system-utils": "^0.14.3"
},

@@ -34,0 +34,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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