@egjs/flicking 4.11.1 → 4.11.2

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/dist/flicking.js CHANGED
@@ -4,7 +4,7 @@ name: @egjs/flicking
4
4
  license: MIT
5
5
  author: NAVER Corp.
6
6
  repository: https://github.com/naver/egjs-flicking
7
- version: 4.11.1
7
+ version: 4.11.2
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@egjs/component'), require('@egjs/axes'), require('@egjs/imready')) :
@@ -2653,6 +2653,7 @@ version: 4.11.1
2653
2653
  var _a;
2654
2654
  var flicking = getFlickingAttached(this._flicking);
2655
2655
  this._activePanel = newActivePanel;
2656
+ this._nextPanel = null;
2656
2657
  flicking.camera.updateAdaptiveHeight();
2657
2658
  if (newActivePanel !== prevActivePanel) {
2658
2659
  flicking.trigger(new Component.ComponentEvent(EVENTS.CHANGED, {
@@ -2689,6 +2690,7 @@ version: 4.11.1
2689
2690
  isTrusted: (axesEvent === null || axesEvent === void 0 ? void 0 : axesEvent.isTrusted) || false,
2690
2691
  direction: getDirection((_a = activePanel === null || activePanel === void 0 ? void 0 : activePanel.position) !== null && _a !== void 0 ? _a : camera.position, position)
2691
2692
  });
2693
+ this._nextPanel = panel;
2692
2694
  flicking.trigger(event);
2693
2695
  if (event.isCanceled()) {
2694
2696
  throw new FlickingError(MESSAGE.STOP_CALLED_BY_USER, CODE.STOP_CALLED_BY_USER);
@@ -3276,19 +3278,20 @@ version: 4.11.1
3276
3278
  * @return {Promise<void>} A Promise which will be resolved after reaching the target position<ko>해당 좌표 도달시에 resolve되는 Promise</ko>
3277
3279
  */
3278
3280
  __proto.moveToPosition = function (position, duration, axesEvent) {
3281
+ var _a;
3279
3282
  var flicking = getFlickingAttached(this._flicking);
3280
3283
  var camera = flicking.camera;
3281
- var activePanel = this._activePanel;
3284
+ var currentPanel = (_a = this._nextPanel) !== null && _a !== void 0 ? _a : this._activePanel;
3282
3285
  var axesRange = this._controller.range;
3283
3286
  var indexRange = this._indexRange;
3284
3287
  var cameraRange = camera.range;
3285
3288
  var state = this._controller.state;
3286
3289
  var clampedPosition = clamp(camera.clampToReachablePosition(position), axesRange[0], axesRange[1]);
3287
3290
  var anchorAtPosition = camera.findAnchorIncludePosition(clampedPosition);
3288
- if (!anchorAtPosition || !activePanel) {
3291
+ if (!anchorAtPosition || !currentPanel) {
3289
3292
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
3290
3293
  }
3291
- var prevPos = activePanel.position;
3294
+ var prevPos = currentPanel.position;
3292
3295
  var posDelta = flicking.animating ? state.delta : position - camera.position;
3293
3296
  var isOverThreshold = Math.abs(posDelta) >= flicking.threshold;
3294
3297
  var adjacentAnchor = position > prevPos ? camera.getNextAnchor(anchorAtPosition) : camera.getPrevAnchor(anchorAtPosition);
@@ -3305,7 +3308,7 @@ version: 4.11.1
3305
3308
  var targetAnchor = position < cameraRange.min ? firstAnchor : lastAnchor;
3306
3309
  targetPanel = targetAnchor.panel;
3307
3310
  targetPos = targetAnchor.position;
3308
- } else if (isOverThreshold && anchorAtPosition.position !== activePanel.position) {
3311
+ } else if (isOverThreshold && anchorAtPosition.position !== currentPanel.position) {
3309
3312
  // Move to anchor at position
3310
3313
  targetPanel = anchorAtPosition.panel;
3311
3314
  targetPos = anchorAtPosition.position;
@@ -7914,7 +7917,7 @@ version: 4.11.1
7914
7917
  * Flicking.VERSION; // ex) 4.0.0
7915
7918
  * ```
7916
7919
  */
7917
- Flicking.VERSION = "4.11.1";
7920
+ Flicking.VERSION = "4.11.2";
7918
7921
  return Flicking;
7919
7922
  }(Component);
7920
7923