@egjs/flicking 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egjs/flicking",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.",
5
5
  "main": "dist/flicking.js",
6
6
  "module": "dist/flicking.esm.js",
@@ -368,7 +368,7 @@ class AxesController {
368
368
  };
369
369
 
370
370
  private _onAxesChange = () => {
371
- this._dragged = true;
371
+ this._dragged = !!this._panInput?.isEnabled();
372
372
  };
373
373
 
374
374
  private _preventClickWhenDragged = (e: MouseEvent) => {
@@ -111,10 +111,13 @@ class SnapControl extends Control {
111
111
  targetAnchor = this._findSnappedAnchor(position, anchorAtCamera);
112
112
  } else if (absPosDelta >= flicking.threshold && absPosDelta > 0) {
113
113
  // Move to the adjacent panel
114
- targetAnchor = this._findAdjacentAnchor(posDelta, anchorAtCamera);
114
+ targetAnchor = this._findAdjacentAnchor(position, posDelta, anchorAtCamera);
115
115
  } else {
116
116
  // Restore to active panel
117
- targetAnchor = anchorAtCamera;
117
+ return this.moveToPanel(activeAnchor.panel, {
118
+ duration,
119
+ axesEvent
120
+ });
118
121
  }
119
122
 
120
123
  this._triggerIndexChangeEvent(targetAnchor.panel, position, axesEvent);
@@ -190,9 +193,18 @@ class SnapControl extends Control {
190
193
  }
191
194
  }
192
195
 
193
- private _findAdjacentAnchor(posDelta: number, anchorAtCamera: AnchorPoint): AnchorPoint {
196
+ private _findAdjacentAnchor(position: number, posDelta: number, anchorAtCamera: AnchorPoint): AnchorPoint {
194
197
  const flicking = getFlickingAttached(this._flicking);
195
198
  const camera = flicking.camera;
199
+
200
+ if (camera.circularEnabled) {
201
+ const anchorIncludePosition = camera.findAnchorIncludePosition(position);
202
+
203
+ if (anchorIncludePosition && anchorIncludePosition.position !== anchorAtCamera.position) {
204
+ return anchorIncludePosition;
205
+ }
206
+ }
207
+
196
208
  const adjacentAnchor = (posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) ?? anchorAtCamera;
197
209
 
198
210
  return adjacentAnchor;
package/TODO.md DELETED
@@ -1,3 +0,0 @@
1
- ## React 18 대응
2
- - [] updateoffset을 미루기
3
- - render가 완료되기 전에 updateOffset이 3번 호출되었음