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

rc-menu

Package Overview
Dependencies
Maintainers
9
Versions
280
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-menu - npm Package Compare versions

Comparing version 9.1.1 to 9.2.1

24

es/hooks/useAccessibility.js

@@ -13,3 +13,5 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

ENTER = KeyCode.ENTER,
ESC = KeyCode.ESC;
ESC = KeyCode.ESC,
HOME = KeyCode.HOME,
END = KeyCode.END;
var ArrowKeys = [UP, DOWN, LEFT, RIGHT];

@@ -168,3 +170,3 @@

if ([].concat(ArrowKeys, [ENTER, ESC]).includes(which)) {
if ([].concat(ArrowKeys, [ENTER, ESC, HOME, END]).includes(which)) {
// Convert key to elements

@@ -199,3 +201,3 @@ var elements;

if (!offsetObj) {
if (!offsetObj && which !== HOME && which !== END) {
return;

@@ -205,3 +207,3 @@ } // Arrow prevent default to avoid page scroll

if (ArrowKeys.includes(which)) {
if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {
e.preventDefault();

@@ -237,3 +239,3 @@ }

if (offsetObj.sibling || !focusMenuElement) {
if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {
// ========================== Sibling ==========================

@@ -250,4 +252,14 @@ // Find walkable focus menu element container

var targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset); // Focus menu item
var targetElement;
var focusableElements = getFocusableElements(parentQueryContainer, elements);
if (which === HOME) {
targetElement = focusableElements[0];
} else if (which === END) {
targetElement = focusableElements[focusableElements.length - 1];
} else {
targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);
} // Focus menu item
tryFocus(targetElement); // ======================= InlineTrigger =======================

@@ -254,0 +266,0 @@ } else if (offsetObj.inlineTrigger) {

@@ -30,3 +30,5 @@ "use strict";

ENTER = _KeyCode.default.ENTER,
ESC = _KeyCode.default.ESC;
ESC = _KeyCode.default.ESC,
HOME = _KeyCode.default.HOME,
END = _KeyCode.default.END;
var ArrowKeys = [UP, DOWN, LEFT, RIGHT];

@@ -185,3 +187,3 @@

if ([].concat(ArrowKeys, [ENTER, ESC]).includes(which)) {
if ([].concat(ArrowKeys, [ENTER, ESC, HOME, END]).includes(which)) {
// Convert key to elements

@@ -216,3 +218,3 @@ var elements;

if (!offsetObj) {
if (!offsetObj && which !== HOME && which !== END) {
return;

@@ -222,3 +224,3 @@ } // Arrow prevent default to avoid page scroll

if (ArrowKeys.includes(which)) {
if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {
e.preventDefault();

@@ -254,3 +256,3 @@ }

if (offsetObj.sibling || !focusMenuElement) {
if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {
// ========================== Sibling ==========================

@@ -267,4 +269,14 @@ // Find walkable focus menu element container

var targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset); // Focus menu item
var targetElement;
var focusableElements = getFocusableElements(parentQueryContainer, elements);
if (which === HOME) {
targetElement = focusableElements[0];
} else if (which === END) {
targetElement = focusableElements[focusableElements.length - 1];
} else {
targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);
} // Focus menu item
tryFocus(targetElement); // ======================= InlineTrigger =======================

@@ -271,0 +283,0 @@ } else if (offsetObj.inlineTrigger) {

{
"name": "rc-menu",
"version": "9.1.1",
"version": "9.2.1",
"description": "menu ui component for react",

@@ -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