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

@clayui/shared

Package Overview
Dependencies
Maintainers
13
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clayui/shared - npm Package Compare versions

Comparing version 3.103.1 to 3.104.0

40

lib/useNavigation.js

@@ -65,9 +65,25 @@ "use strict";

var element = item instanceof HTMLElement ? item : document.getElementById(String(item));
onNavigate(item, index);
if (onNavigate) {
onNavigate(item, index);
}
if (collection !== null && collection !== void 0 && collection.virtualize) {
var isEnd = collection.UNSAFE_virtualizer.options.count - 1 === index;
var isStart = index === 0;
collection.UNSAFE_virtualizer.scrollToIndex(index, {
align: 'auto',
behavior: 'smooth'
behavior: isStart || isEnd ? 'auto' : 'smooth'
});
if (!onNavigate && !element) {
setTimeout(function () {
var nextFocus = containerRef.current.querySelector("[data-focus=\"".concat(item, "\"]"));
if (nextFocus) {
nextFocus.focus();
}
}, 20);
}
return;

@@ -112,8 +128,18 @@ }

if (collection) {
var _key = orientation === 'vertical' ? _Keys.Keys.Up : _Keys.Keys.Left;
if (collection && typeof active === 'string') {
position = items.indexOf(active);
} else {
} else if (collection) {
var activeElement = document.activeElement;
position = items.indexOf(activeElement);
var focusKey = activeElement.getAttribute('data-focus');
position = items.indexOf(focusKey);
if (position === -1) {
_item = event.key === _key ? collection.getLastItem().key : collection.getFirstItem().key;
}
} else {
var _activeElement = document.activeElement;
position = items.indexOf(_activeElement);
if (typeof active === 'string') {

@@ -130,4 +156,2 @@ position = items.findIndex(function (element) {

var _key = orientation === 'vertical' ? _Keys.Keys.Up : _Keys.Keys.Left;
_item = items[event.key === _key ? position - 1 : position + 1];

@@ -205,3 +229,3 @@

if (onNavigate) {
if (onNavigate || !element) {
accessibilityFocus(_item, items);

@@ -208,0 +232,0 @@ } else {

4

package.json
{
"name": "@clayui/shared",
"version": "3.103.1",
"version": "3.104.0",
"description": "ClayShared component",

@@ -45,3 +45,3 @@ "license": "BSD-3-Clause",

],
"gitHead": "cd95e9b9561858fb6832a524a2a0b0304a500d3f"
"gitHead": "44f72fac40321954bf46e8f61b163ff71ae04403"
}

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