()
| 1105 | } |
| 1106 | |
| 1107 | private async moveToNextBreakpoint() { |
| 1108 | const { breakpoints, currentBreakpoint } = this; |
| 1109 | |
| 1110 | if (!breakpoints || currentBreakpoint == null) { |
| 1111 | /** |
| 1112 | * If the modal does not have breakpoints and/or the current |
| 1113 | * breakpoint is not set, we can't move to the next breakpoint. |
| 1114 | */ |
| 1115 | return false; |
| 1116 | } |
| 1117 | |
| 1118 | const allowedBreakpoints = breakpoints.filter((b) => b !== 0); |
| 1119 | const currentBreakpointIndex = allowedBreakpoints.indexOf(currentBreakpoint); |
| 1120 | const nextBreakpointIndex = (currentBreakpointIndex + 1) % allowedBreakpoints.length; |
| 1121 | const nextBreakpoint = allowedBreakpoints[nextBreakpointIndex]; |
| 1122 | |
| 1123 | /** |
| 1124 | * Sets the current breakpoint to the next available breakpoint. |
| 1125 | * If the current breakpoint is the last breakpoint, we set the current |
| 1126 | * breakpoint to the first non-zero breakpoint to avoid dismissing the sheet. |
| 1127 | */ |
| 1128 | await this.setCurrentBreakpoint(nextBreakpoint); |
| 1129 | return true; |
| 1130 | } |
| 1131 | |
| 1132 | private onHandleClick = () => { |
| 1133 | const { sheetTransition, handleBehavior } = this; |
no test coverage detected