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

@vaadin/a11y-base

Package Overview
Dependencies
Maintainers
12
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/a11y-base - npm Package Compare versions

Comparing version 24.1.13 to 24.1.14

6

package.json
{
"name": "@vaadin/a11y-base",
"version": "24.1.13",
"version": "24.1.14",
"publishConfig": {

@@ -35,3 +35,3 @@ "access": "public"

"@polymer/polymer": "^3.0.0",
"@vaadin/component-base": "~24.1.13",
"@vaadin/component-base": "~24.1.14",
"lit": "^2.0.0"

@@ -44,3 +44,3 @@ },

},
"gitHead": "cc297ef7458e98e210db17bfb18eec7ad2932f42"
"gitHead": "ddff030b439f28a7b7f61ceae706d3dd9564a2b4"
}

@@ -58,1 +58,9 @@ /**

export declare function getFocusableElements(element: HTMLElement): HTMLElement[];
/**
* Returns a closest focusable ancestor of an element,
* or an element itself in case if it's focusable.
*
* The method traverses nodes in shadow DOM trees too if any.
*/
export declare function getClosestFocusable(element: HTMLElement): HTMLElement | undefined;

@@ -277,1 +277,41 @@ /**

}
/**
* Returns an ancestor for the given node.
*
* @param {Node} node
* @return {Node}
* @private
*/
function getAncestor(node) {
if (node.nodeType === Node.ELEMENT_NODE && node.assignedSlot) {
return node.assignedSlot;
}
if (node instanceof ShadowRoot) {
return node.host;
}
return node.parentNode;
}
/**
* Returns a closest focusable ancestor of an element,
* or an element itself in case if it's focusable.
*
* The method traverses nodes in shadow DOM trees too if any.
*
* @param {HTMLElement} element
* @return {HTMLElement | undefined}
*/
export function getClosestFocusable(element) {
let current = element;
while (current !== document.body) {
if (current.nodeType === Node.ELEMENT_NODE && isElementFocusable(current)) {
return current;
}
current = getAncestor(current);
}
}

@@ -254,3 +254,3 @@ /**

const currentIdx = this.items.indexOf(this.focused);
if (/[a-zA-Z0-9]/u.test(key) && key.length === 1) {
if (/[\p{L}\p{Nd}]/u.test(key) && key.length === 1) {
const idx = this._searchKey(currentIdx, key);

@@ -257,0 +257,0 @@ if (idx >= 0) {

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