@@ -253,27 +253,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
253253 return eventMethod ( this . el , 'ionActionSheetWillDismiss' ) ;
254254 }
255255
256- private focusFirstElement ( ) {
257- if ( ! this . wrapperEl ) return ; // Check if wrapperEl is defined
258- const firstFocusable = this . wrapperEl ?. querySelector (
259- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
260- ) ;
261- if ( firstFocusable ) {
262- ( firstFocusable as HTMLElement ) . focus ( ) ;
263- }
264- }
265-
266- // Method to focus the last focusable element
267- private focusLastElement ( ) {
268- if ( ! this . wrapperEl ) return ; // Check if wrapperEl is defined
269- const focusableElements = this . wrapperEl . querySelectorAll (
270- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
271- ) ;
272- if ( focusableElements . length > 0 ) {
273- ( focusableElements [ focusableElements . length - 1 ] as HTMLElement ) . focus ( ) ;
274- }
275- }
276-
277256 private async buttonClick ( button : ActionSheetButton ) {
278257 const role = button . role ;
279258 if ( isCancel ( role ) ) {
@@ -406,23 +385,23 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
406385 >
407386 < ion-backdrop tappable = { this . backdropDismiss } />
408387
409- < div tabindex = "0" aria-hidden = "true" onFocus = { ( ) => this . focusLastElement ( ) } > </ div >
388+ < div tabindex = "0" aria-hidden = "true" > </ div >
410389
411390 < div class = "action-sheet-wrapper ion-overlay-wrapper" ref = { ( el ) => ( this . wrapperEl = el ) } >
412391 < div class = "action-sheet-container" >
413392 < div class = "action-sheet-group" ref = { ( el ) => ( this . groupEl = el ) } >
414393 { header !== undefined && (
415- < div
394+ < h2
416395 id = { headerID }
417396 class = { {
418397 'action-sheet-title' : true ,
419398 'action-sheet-has-sub-title' : this . subHeader !== undefined ,
420399 } }
421400 >
422401 { header }
423- { this . subHeader && < div class = "action-sheet-sub-title" > { this . subHeader } </ div > }
424- </ div >
402+ </ h2 >
425403 ) }
404+ { this . subHeader && < h2 class = "action-sheet-sub-title" > { this . subHeader } </ h2 > }
426405 { buttons . map ( ( b ) => (
427406 < button
428407 { ...b . htmlAttributes }
@@ -467,7 +446,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
467446 </ div >
468447 </ div >
469448
470- < div tabindex = "0" aria-hidden = "true" onFocus = { ( ) => this . focusFirstElement ( ) } > </ div >
449+ < div tabindex = "0" aria-hidden = "true" > </ div >
471450 </ Host >
472451 ) ;
473452 }
0 commit comments