@reach/combobox
Advanced tools
Comparing version 0.15.3 to 0.16.0
@@ -15,2 +15,3 @@ 'use strict'; | ||
var useUpdateEffect = require('@reach/utils/use-update-effect'); | ||
var useStatefulRefValue = require('@reach/utils/use-stateful-ref-value'); | ||
var composeEventHandlers = require('@reach/utils/compose-event-handlers'); | ||
@@ -762,7 +763,15 @@ var descendants = require('@reach/descendants'); | ||
var ownRef = React.useRef(null); | ||
var ref = composeRefs.useComposedRefs(forwardedRef, ownRef); | ||
var index = descendants.useDescendant({ | ||
element: ownRef.current, | ||
value: value | ||
}, ComboboxDescendantContext); | ||
var _useStatefulRefValue = useStatefulRefValue.useStatefulRefValue(ownRef, null), | ||
element = _useStatefulRefValue[0], | ||
handleRefSet = _useStatefulRefValue[1]; | ||
var descendant = React.useMemo(function () { | ||
return { | ||
element: element, | ||
value: value | ||
}; | ||
}, [value, element]); | ||
var index = descendants.useDescendant(descendant, ComboboxDescendantContext); | ||
var ref = composeRefs.useComposedRefs(forwardedRef, handleRefSet); | ||
var isActive = navigationValue === value; | ||
@@ -769,0 +778,0 @@ |
@@ -15,2 +15,3 @@ 'use strict'; | ||
var useUpdateEffect = require('@reach/utils/use-update-effect'); | ||
var useStatefulRefValue = require('@reach/utils/use-stateful-ref-value'); | ||
var composeEventHandlers = require('@reach/utils/compose-event-handlers'); | ||
@@ -728,7 +729,15 @@ var descendants = require('@reach/descendants'); | ||
var ownRef = React.useRef(null); | ||
var ref = composeRefs.useComposedRefs(forwardedRef, ownRef); | ||
var index = descendants.useDescendant({ | ||
element: ownRef.current, | ||
value: value | ||
}, ComboboxDescendantContext); | ||
var _useStatefulRefValue = useStatefulRefValue.useStatefulRefValue(ownRef, null), | ||
element = _useStatefulRefValue[0], | ||
handleRefSet = _useStatefulRefValue[1]; | ||
var descendant = React.useMemo(function () { | ||
return { | ||
element: element, | ||
value: value | ||
}; | ||
}, [value, element]); | ||
var index = descendants.useDescendant(descendant, ComboboxDescendantContext); | ||
var ref = composeRefs.useComposedRefs(forwardedRef, handleRefSet); | ||
var isActive = navigationValue === value; | ||
@@ -735,0 +744,0 @@ |
@@ -11,2 +11,3 @@ import { forwardRef, useRef, createElement, useContext, useCallback, useEffect, useMemo, Fragment, useState, useReducer } from 'react'; | ||
import { useUpdateEffect } from '@reach/utils/use-update-effect'; | ||
import { useStatefulRefValue } from '@reach/utils/use-stateful-ref-value'; | ||
import { composeEventHandlers } from '@reach/utils/compose-event-handlers'; | ||
@@ -754,7 +755,15 @@ import { createDescendantContext, useDescendantsInit, DescendantProvider, useDescendant, useDescendants } from '@reach/descendants'; | ||
var ownRef = useRef(null); | ||
var ref = useComposedRefs(forwardedRef, ownRef); | ||
var index = useDescendant({ | ||
element: ownRef.current, | ||
value: value | ||
}, ComboboxDescendantContext); | ||
var _useStatefulRefValue = useStatefulRefValue(ownRef, null), | ||
element = _useStatefulRefValue[0], | ||
handleRefSet = _useStatefulRefValue[1]; | ||
var descendant = useMemo(function () { | ||
return { | ||
element: element, | ||
value: value | ||
}; | ||
}, [value, element]); | ||
var index = useDescendant(descendant, ComboboxDescendantContext); | ||
var ref = useComposedRefs(forwardedRef, handleRefSet); | ||
var isActive = navigationValue === value; | ||
@@ -761,0 +770,0 @@ |
{ | ||
"name": "@reach/combobox", | ||
"version": "0.15.3", | ||
"version": "0.16.0", | ||
"description": "Accessible React Combobox (Autocomplete).", | ||
@@ -16,7 +16,7 @@ "author": "React Training <hello@reacttraining.com>", | ||
"dependencies": { | ||
"@reach/auto-id": "0.15.3", | ||
"@reach/descendants": "0.15.3", | ||
"@reach/popover": "0.15.3", | ||
"@reach/portal": "0.15.3", | ||
"@reach/utils": "0.15.3", | ||
"@reach/auto-id": "0.16.0", | ||
"@reach/descendants": "0.16.0", | ||
"@reach/popover": "0.16.0", | ||
"@reach/portal": "0.16.0", | ||
"@reach/utils": "0.16.0", | ||
"prop-types": "^15.7.2", | ||
@@ -46,3 +46,3 @@ "tslib": "^2.3.0" | ||
], | ||
"gitHead": "aac3d3e1902ec32656476bcdccd7b56207384fcd" | ||
"gitHead": "e4c6093db14e3cc24c26794a002dbd8c866c0387" | ||
} |
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
138913
3575
+ Added@reach/auto-id@0.16.0(transitive)
+ Added@reach/descendants@0.16.0(transitive)
+ Added@reach/popover@0.16.0(transitive)
+ Added@reach/portal@0.16.0(transitive)
+ Added@reach/rect@0.16.0(transitive)
+ Added@reach/utils@0.16.0(transitive)
- Removed@reach/auto-id@0.15.3(transitive)
- Removed@reach/descendants@0.15.3(transitive)
- Removed@reach/popover@0.15.3(transitive)
- Removed@reach/portal@0.15.3(transitive)
- Removed@reach/rect@0.15.3(transitive)
- Removed@reach/utils@0.15.3(transitive)
Updated@reach/auto-id@0.16.0
Updated@reach/descendants@0.16.0
Updated@reach/popover@0.16.0
Updated@reach/portal@0.16.0
Updated@reach/utils@0.16.0