MCPcopy Create free account
hub / github.com/dailydotdev/apps / beginDrag

Function beginDrag

packages/shared/src/components/shell/sheetDrag.ts:137–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

onTouchMoveFunction · 0.85

Calls 3

endSettleFunction · 0.85
isExpandedFunction · 0.85
measureFullFunction · 0.85

Tested by

no test coverage detected