()
| 135 | }; |
| 136 | |
| 137 | const beginDrag = () => { |
| 138 | endSettle(); |
| 139 | dragging = true; |
| 140 | startedExpanded = isExpanded(); |
| 141 | fullHeight = measureFull(); |
| 142 | const current = panel.offsetHeight; |
| 143 | if (!startedExpanded || !restHeight) { |
| 144 | restHeight = startedExpanded |
| 145 | ? Math.min(restHeight || current, current) |
| 146 | : current; |
| 147 | } |
| 148 | if (startedExpanded && !restHeight) { |
| 149 | restHeight = current; |
| 150 | } |
| 151 | panel.setAttribute('data-dragging', 'true'); |
| 152 | panel.setAttribute('data-entered', 'true'); |
| 153 | style.setProperty('--sheet-gap', `${Math.max(0, fullHeight - current)}px`); |
| 154 | // The inline height drives the sheet while a finger is down. |
| 155 | panel.removeAttribute('data-expanded'); |
| 156 | style.transition = 'none'; |
| 157 | style.maxHeight = 'none'; |
| 158 | style.height = `${current}px`; |
| 159 | }; |
| 160 | |
| 161 | const onTouchMove = (event: TouchEvent) => { |
| 162 | if (!tracking) { |
no test coverage detected