Skip to content

Commit 86437ae

Browse files
committed
fix(modal): add conditional tabIndex for handle cycling
1 parent cc9e211 commit 86437ae

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/src/components/modal/modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,8 @@ export class Modal implements ComponentInterface, OverlayInterface {
967967
return (
968968
<Host
969969
no-router
970-
tabindex="-1"
970+
// Allow the modal to be navigable when the handle is focusable
971+
tabIndex={!isHandleCycle ? -1 : 0}
971972
{...(htmlAttributes as any)}
972973
style={{
973974
zIndex: `${20000 + this.overlayIndex}`,

core/src/components/modal/test/sheet/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@
106106
>
107107
Present Sheet Modal (Scroll at any breakpoint)
108108
</button>
109+
<button
110+
id="scroll-at-edge-modal"
111+
onclick="presentModal({ handleBehavior: 'cycle', backdropBreakpoint: 1, backdropDismiss: false, initialBreakpoint: 0.5, breakpoints: [0, 0.25, 0.5, 0.75, 1], expandToScroll: false })"
112+
>
113+
Present Sheet Modal (Cycle Handle, Scroll at any breakpoint)
114+
</button>
109115
<button
110116
id="custom-backdrop-modal"
111117
onclick="presentModal({ backdropBreakpoint: 0.5, initialBreakpoint: 0.5 })"

0 commit comments

Comments
 (0)