File tree Expand file tree Collapse file tree 1 file changed +26
-5
lines changed
packages/@react-spectrum/picker/stories Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -236,14 +236,35 @@ export const FalsyKey: PickerStory = {
236
236
name : 'falsy item key'
237
237
} ;
238
238
239
- export const NoLabel : PickerStory = {
239
+ export type LabelledByStory = ComponentStoryObj < any > ;
240
+ export const LabelledBy : LabelledByStory = {
240
241
args : {
241
- children : ( item : any ) => < Item > { item . name } </ Item > ,
242
- items : flatOptions ,
243
- 'aria-label' : 'Test' ,
242
+ 'aria-label' : null ,
243
+ 'aria-labelledby' : true ,
244
244
label : null
245
245
} ,
246
- name : 'no visible label'
246
+ argTypes : {
247
+ 'aria-label' : {
248
+ control : 'text'
249
+ } ,
250
+ 'aria-labelledby' : {
251
+ control : 'boolean'
252
+ }
253
+ } ,
254
+ render : ( args ) => (
255
+ < >
256
+ < div id = "test label" > Test label</ div >
257
+ < Picker { ...args } aria-labelledby = { args [ 'aria-labelledby' ] ? 'test label' : null } items = { flatOptions } >
258
+ { ( item : any ) => < Item > { item . name } </ Item > }
259
+ </ Picker >
260
+ </ >
261
+ ) ,
262
+ name : 'no visible label combination story' ,
263
+ parameters : {
264
+ description : {
265
+ data : 'Use controls to add/remove a visible label, aria-label, and toggle the aria-labelledby on/off'
266
+ }
267
+ }
247
268
} ;
248
269
249
270
export const ContextualHelpPicker : PickerStory = {
You can’t perform that action at this time.
0 commit comments