@react-stately/collections
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -21,3 +21,3 @@ var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends")); | ||
$de85adf0b38f4f13e9cffd2f21$var$Item.getCollectionNode = function* getCollectionNode(props) { | ||
$de85adf0b38f4f13e9cffd2f21$var$Item.getCollectionNode = function* getCollectionNode(props, context) { | ||
let { | ||
@@ -29,5 +29,5 @@ childItems, | ||
let rendered = props.title || props.children; | ||
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || ''; | ||
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || ''; // suppressTextValueWarning is used in components like Tabs, which don't have type to select support. | ||
if (!textValue) { | ||
if (!textValue && !(context == null ? void 0 : context.suppressTextValueWarning)) { | ||
console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.'); | ||
@@ -34,0 +34,0 @@ } |
@@ -9,3 +9,3 @@ import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
$e92117d6e5313ef8e7c10fac1de193ce$var$Item.getCollectionNode = function* getCollectionNode(props) { | ||
$e92117d6e5313ef8e7c10fac1de193ce$var$Item.getCollectionNode = function* getCollectionNode(props, context) { | ||
let { | ||
@@ -17,5 +17,5 @@ childItems, | ||
let rendered = props.title || props.children; | ||
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || ''; | ||
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || ''; // suppressTextValueWarning is used in components like Tabs, which don't have type to select support. | ||
if (!textValue) { | ||
if (!textValue && !(context == null ? void 0 : context.suppressTextValueWarning)) { | ||
console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.'); | ||
@@ -22,0 +22,0 @@ } |
{ | ||
"name": "@react-stately/collections", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,3 +21,3 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-types/shared": "^3.5.0" | ||
"@react-types/shared": "^3.6.0" | ||
}, | ||
@@ -30,3 +30,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "9920ffaa2596a03c4498a15cb940bd2f4ba5cd6a" | ||
"gitHead": "3aae08e7d8a75382bedcddac7c86107e40db9296" | ||
} |
@@ -21,3 +21,3 @@ /* | ||
Item.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>): Generator<PartialNode<T>> { | ||
Item.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>, context: any): Generator<PartialNode<T>> { | ||
let {childItems, title, children} = props; | ||
@@ -27,3 +27,5 @@ | ||
let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || ''; | ||
if (!textValue) { | ||
// suppressTextValueWarning is used in components like Tabs, which don't have type to select support. | ||
if (!textValue && !context?.suppressTextValueWarning) { | ||
console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.'); | ||
@@ -30,0 +32,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
109891
1128
Updated@react-types/shared@^3.6.0