Skip to content

Commit 0b1c67d

Browse files
committed
fix(modal): updating tests, making tabIndex condition more specific
1 parent 0b13203 commit 0b1c67d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/components/modal/modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,12 +965,13 @@ export class Modal implements ComponentInterface, OverlayInterface {
965965
const mode = getIonMode(this);
966966
const isCardModal = presentingElement !== undefined && mode === 'ios';
967967
const isHandleCycle = handleBehavior === 'cycle';
968+
const isSheetModalWithHandle = isSheetModal && showHandle;
968969

969970
return (
970971
<Host
971972
no-router
972973
// Allow the modal to be navigable when the handle is focusable
973-
tabIndex={!isHandleCycle ? -1 : 0}
974+
tabIndex={isHandleCycle && isSheetModalWithHandle ? 0 : -1}
974975
{...(htmlAttributes as any)}
975976
style={{
976977
zIndex: `${20000 + this.overlayIndex}`,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
Present Sheet Modal (Scroll at any breakpoint)
108108
</button>
109109
<button
110-
id="scroll-at-edge-modal"
110+
id="cycle-scroll-no-backdrop"
111111
onclick="presentModal({ handleBehavior: 'cycle', backdropBreakpoint: 1, backdropDismiss: false, initialBreakpoint: 0.5, breakpoints: [0, 0.25, 0.5, 0.75, 1], expandToScroll: false })"
112112
>
113113
Present Sheet Modal (Cycle Handle, Scroll at any breakpoint)

0 commit comments

Comments
 (0)