11import type { ComponentInterface , EventEmitter } from '@stencil/core' ;
22import { Watch , Component , Element , Event , Host , Listen , Method , Prop , State , h , readTask } from '@stencil/core' ;
3- import { ENABLE_HTML_CONTENT_DEFAULT } from '@utils/config' ;
43import type { Gesture } from '@utils/gesture' ;
54import { createButtonActiveGesture } from '@utils/gesture/button-active' ;
65import { raf } from '@utils/helpers' ;
@@ -17,10 +16,9 @@ import {
1716 safeCall ,
1817 setOverlayId ,
1918} from '@utils/overlays' ;
20- import { sanitizeDOMString } from '@utils/sanitization ' ;
19+ import { renderOptionLabel } from '@utils/select-option-render ' ;
2120import { getClassMap } from '@utils/theme' ;
2221
23- import { config } from '../../global/config' ;
2422import { getIonMode , getIonTheme } from '../../global/ionic-global' ;
2523import type { AnimationBuilder , CssClassMap , FrameworkDelegate , OverlayInterface } from '../../interface' ;
2624import type { OverlayEventDetail } from '../../utils/overlays-interface' ;
@@ -40,7 +38,7 @@ import { mdLeaveAnimation } from './animations/md.leave';
4038 styleUrls : {
4139 ios : 'action-sheet.ios.scss' ,
4240 md : 'action-sheet.md.scss' ,
43- ionic : 'action-sheet.md .scss' ,
41+ ionic : 'action-sheet.ionic .scss' ,
4442 } ,
4543 scoped : true ,
4644} )
@@ -52,7 +50,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
5250 private groupEl ?: HTMLElement ;
5351 private gesture ?: Gesture ;
5452 private hasRadioButtons = false ;
55- private customHTMLEnabled = config . get ( 'innerHTMLTemplatesEnabled' , ENABLE_HTML_CONTENT_DEFAULT ) ;
5653
5754 presented = false ;
5855 lastFocus ?: HTMLElement ;
@@ -563,6 +560,14 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
563560 htmlAttrs [ 'aria-checked' ] = isActiveRadio ? 'true' : 'false' ;
564561 }
565562
563+ const optionLabelOptions = {
564+ id : buttonId ,
565+ label : b . text ,
566+ startContent : b . startContent ,
567+ endContent : b . endContent ,
568+ description : b . description ,
569+ } ;
570+
566571 return (
567572 < button
568573 { ...htmlAttrs }
@@ -584,7 +589,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
584589 >
585590 < span class = "action-sheet-button-inner" >
586591 { b . icon && < ion-icon icon = { b . icon } aria-hidden = "true" lazy = { false } class = "action-sheet-icon" /> }
587- { this . customHTMLEnabled ? < span innerHTML = { sanitizeDOMString ( b . text ) } > </ span > : b . text }
592+ { renderOptionLabel ( optionLabelOptions , 'action-sheet-button-label' ) }
588593 </ span >
589594 { theme === 'md' && < ion-ripple-effect > </ ion-ripple-effect > }
590595 </ button >
0 commit comments