MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / tryToCapturePan

Function tryToCapturePan

core/src/utils/gesture/index.ts:123–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 };
122
123 const tryToCapturePan = (): boolean => {
124 if (!gesture.capture()) {
125 return false;
126 }
127 hasCapturedPan = true;
128 hasFiredStart = false;
129
130 // reset start position since the real user-land event starts here
131 // If the pan detector threshold is big, not resetting the start position
132 // will cause a jump in the animation equal to the detector threshold.
133 // the array of positions used to calculate the gesture velocity does not
134 // need to be cleaned, more points in the positions array always results in a
135 // more accurate value of the velocity.
136 detail.startX = detail.currentX;
137 detail.startY = detail.currentY;
138 detail.startTime = detail.currentTime;
139
140 if (onWillStart) {
141 onWillStart(detail).then(fireOnStart);
142 } else {
143 fireOnStart();
144 }
145 return true;
146 };
147
148 const blurActiveElement = () => {
149 if (typeof document !== 'undefined') {

Callers 2

pointerDownFunction · 0.85
pointerMoveFunction · 0.85

Calls 2

fireOnStartFunction · 0.85
captureMethod · 0.45

Tested by

no test coverage detected