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.3.0-toolbar-item-use-press.3 to 0.3.0-toolbar-item-use-press.4

17

dist/main.js

@@ -16,9 +16,16 @@ 'use strict';

}) => {
if (disabled || preventFocusOnPress === null) {
if (disabled) {
return;
}
if (!preventFocusOnPress) {
utils.focusWithoutScrolling(target);
} else if (document.activeElement !== target) {
document.activeElement.blur();
switch (preventFocusOnPress) {
case "auto":
break;
case true:
document.activeElement.blur();
break;
case false:
if (document.activeElement !== target) {
utils.focusWithoutScrolling(target);
}
break;
}

@@ -25,0 +32,0 @@ };

@@ -12,9 +12,16 @@ import { useRef, useState, useEffect } from 'react';

}) => {
if (disabled || preventFocusOnPress === null) {
if (disabled) {
return;
}
if (!preventFocusOnPress) {
focusWithoutScrolling(target);
} else if (document.activeElement !== target) {
document.activeElement.blur();
switch (preventFocusOnPress) {
case "auto":
break;
case true:
document.activeElement.blur();
break;
case false:
if (document.activeElement !== target) {
focusWithoutScrolling(target);
}
break;
}

@@ -21,0 +28,0 @@ };

@@ -57,4 +57,9 @@ import { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaRole, CSSProperties } from 'react';

disabled?: boolean;
/** Whether the target should not receive focus on press. */
preventFocusOnPress?: boolean | null;
/**
* Controls the focus behavior on press for the target component.
* - 'auto': The usePress does not manage focus on press.
* - true: Prevents the target component from receiving focus when pressed.
* - false: Focus is applied to the target component when pressed, without scrolling the page.
*/
preventFocusOnPress?: boolean | 'auto';
/** Whether text selection should be enabled on the pressable element. */

@@ -61,0 +66,0 @@ allowTextSelectionOnPress?: boolean;

{
"name": "@mirohq/design-system-use-press",
"version": "0.3.0-toolbar-item-use-press.3",
"version": "0.3.0-toolbar-item-use-press.4",
"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.6"
"@mirohq/design-system-use-logger": "^0.1.6",
"@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