@chakra-ui/descendant
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -109,3 +109,3 @@ 'use strict'; | ||
descendant.index = index; | ||
descendant.node.dataset.index = descendant.index.toString(); | ||
descendant.node.dataset["index"] = descendant.index.toString(); | ||
}); | ||
@@ -297,3 +297,3 @@ }; | ||
if (!ref.current) return; | ||
var dataIndex = Number(ref.current.dataset.index); | ||
var dataIndex = Number(ref.current.dataset["index"]); | ||
@@ -300,0 +300,0 @@ if (index != dataIndex && !Number.isNaN(dataIndex)) { |
@@ -109,3 +109,3 @@ 'use strict'; | ||
descendant.index = index; | ||
descendant.node.dataset.index = descendant.index.toString(); | ||
descendant.node.dataset["index"] = descendant.index.toString(); | ||
}); | ||
@@ -297,3 +297,3 @@ }; | ||
if (!ref.current) return; | ||
var dataIndex = Number(ref.current.dataset.index); | ||
var dataIndex = Number(ref.current.dataset["index"]); | ||
@@ -300,0 +300,0 @@ if (index != dataIndex && !Number.isNaN(dataIndex)) { |
@@ -105,3 +105,3 @@ import { createContext, mergeRefs } from '@chakra-ui/react-utils'; | ||
descendant.index = index; | ||
descendant.node.dataset.index = descendant.index.toString(); | ||
descendant.node.dataset["index"] = descendant.index.toString(); | ||
}); | ||
@@ -293,3 +293,3 @@ }; | ||
if (!ref.current) return; | ||
var dataIndex = Number(ref.current.dataset.index); | ||
var dataIndex = Number(ref.current.dataset["index"]); | ||
@@ -296,0 +296,0 @@ if (index != dataIndex && !Number.isNaN(dataIndex)) { |
{ | ||
"name": "@chakra-ui/descendant", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Register child nodes of a react element for better accessibility", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/react-utils": "^1.2.1" | ||
"@chakra-ui/react-utils": "^1.2.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "peerDependencies": { |
@@ -34,3 +34,3 @@ import { sortNodes, isElement, getNextIndex, getPrevIndex } from "./utils" | ||
T extends HTMLElement, | ||
K extends Record<string, any> = {} | ||
K extends Record<string, any> = {}, | ||
> { | ||
@@ -65,3 +65,3 @@ private descendants = new Map<T, Descendant<T, K>>() | ||
descendant.index = index | ||
descendant.node.dataset.index = descendant.index.toString() | ||
descendant.node.dataset["index"] = descendant.index.toString() | ||
}) | ||
@@ -68,0 +68,0 @@ } |
@@ -29,9 +29,8 @@ import { createContext, mergeRefs } from "@chakra-ui/react-utils" | ||
const [ | ||
DescendantsContextProvider, | ||
useDescendantsContext, | ||
] = createContext<UseDescendantsReturn>({ | ||
name: "DescendantsProvider", | ||
errorMessage: "useDescendantsContext must be used within DescendantsProvider", | ||
}) | ||
const [DescendantsContextProvider, useDescendantsContext] = | ||
createContext<UseDescendantsReturn>({ | ||
name: "DescendantsProvider", | ||
errorMessage: | ||
"useDescendantsContext must be used within DescendantsProvider", | ||
}) | ||
@@ -61,3 +60,3 @@ /** | ||
if (!ref.current) return | ||
const dataIndex = Number(ref.current.dataset.index) | ||
const dataIndex = Number(ref.current.dataset["index"]) | ||
if (index != dataIndex && !Number.isNaN(dataIndex)) { | ||
@@ -87,3 +86,3 @@ setIndex(dataIndex) | ||
T extends HTMLElement = HTMLElement, | ||
K = {} | ||
K = {}, | ||
>() { | ||
@@ -90,0 +89,0 @@ type ContextProviderType = React.Provider<DescendantsManager<T, K>> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
47544
19
1172