@egjs/flicking 4.11.3-beta.0 → 4.11.3-beta.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.
@@ -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.3-beta.0
7
+ version: 4.11.3-beta.1
8
8
  */
9
9
  'use strict';
10
10
 
@@ -2868,7 +2868,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2868
2868
  if (!activeAnchor || !anchorAtCamera) {
2869
2869
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
2870
2870
  }
2871
- var snapThreshold = this._calcSnapThreshold(flicking.threshold, position, activeAnchor);
2871
+ var snapThreshold = this._calcSnapThreshold(position, activeAnchor);
2872
2872
  var posDelta = flicking.animating ? state.delta : position - camera.position;
2873
2873
  var absPosDelta = Math.abs(posDelta);
2874
2874
  var snapDelta = axesEvent && axesEvent.delta[POSITION_KEY] !== 0 ? Math.abs(axesEvent.delta[POSITION_KEY]) : absPosDelta;
@@ -2955,7 +2955,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2955
2955
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
2956
2956
  return adjacentAnchor;
2957
2957
  };
2958
- __proto._calcSnapThreshold = function (threshold, position, activeAnchor) {
2958
+ __proto._calcSnapThreshold = function (position, activeAnchor) {
2959
2959
  var isNextDirection = position > activeAnchor.position;
2960
2960
  var panel = activeAnchor.panel;
2961
2961
  var panelSize = panel.size;
@@ -2966,7 +2966,7 @@ var SnapControl = /*#__PURE__*/function (_super) {
2966
2966
  * |<------>|<------------>|
2967
2967
  * [ |<-Anchor ]
2968
2968
  */
2969
- return Math.max(threshold, isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev);
2969
+ return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
2970
2970
  };
2971
2971
  return SnapControl;
2972
2972
  }(Control);
@@ -4171,11 +4171,13 @@ var Camera = /*#__PURE__*/function () {
4171
4171
  * @return {AnchorPoint | null}
4172
4172
  */
4173
4173
  __proto.findActiveAnchor = function () {
4174
+ var _a;
4174
4175
  var flicking = getFlickingAttached(this._flicking);
4175
- var activeIndex = flicking.control.activeIndex;
4176
- return find(this._anchors, function (anchor) {
4177
- return anchor.panel.index === activeIndex;
4178
- });
4176
+ var activePanel = flicking.control.activePanel;
4177
+ if (!activePanel) return null;
4178
+ return (_a = find(this._anchors, function (anchor) {
4179
+ return anchor.panel.index === activePanel.index;
4180
+ })) !== null && _a !== void 0 ? _a : this.findNearestAnchor(activePanel.position);
4179
4181
  };
4180
4182
  /**
4181
4183
  * Clamp the given position between camera's range
@@ -7828,7 +7830,7 @@ var Flicking = /*#__PURE__*/function (_super) {
7828
7830
  * Flicking.VERSION; // ex) 4.0.0
7829
7831
  * ```
7830
7832
  */
7831
- Flicking.VERSION = "4.11.3-beta.0";
7833
+ Flicking.VERSION = "4.11.3-beta.1";
7832
7834
  return Flicking;
7833
7835
  }(Component);
7834
7836