File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
core/src/components/select Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -548,6 +548,7 @@ export class Select implements ComponentInterface {
548548 }
549549
550550 private createActionSheetButtons ( data : HTMLIonSelectOptionElement [ ] , selectValue : any ) : ActionSheetButton [ ] {
551+ console . log ( 'createActionSheetButtons' , data , selectValue ) ;
551552 const actionSheetButtons = data . map ( ( option ) => {
552553 const value = getOptionValue ( option ) ;
553554
@@ -556,14 +557,18 @@ export class Select implements ComponentInterface {
556557 . filter ( ( cls ) => cls !== 'hydrated' )
557558 . join ( ' ' ) ;
558559 const optClass = `${ OPTION_CLASS } ${ copyClasses } ` ;
560+ const isSelected = isOptionSelected ( selectValue , value , this . compareWith ) ;
559561
560562 return {
561- role : isOptionSelected ( selectValue , value , this . compareWith ) ? 'selected' : '' ,
563+ role : isSelected ? 'selected' : '' ,
562564 text : option . textContent ,
563565 cssClass : optClass ,
564566 handler : ( ) => {
565567 this . setValue ( value ) ;
566568 } ,
569+ htmlAttributes : {
570+ 'aria-selected' : isSelected ? 'true' : undefined ,
571+ } ,
567572 } as ActionSheetButton ;
568573 } ) ;
569574
You can’t perform that action at this time.
0 commit comments