@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
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -7071,7 +7071,7 @@ version: 4.11.3-beta.0
7071
7071
  if (!activeAnchor || !anchorAtCamera) {
7072
7072
  return Promise.reject(new FlickingError(MESSAGE.POSITION_NOT_REACHABLE(position), CODE.POSITION_NOT_REACHABLE));
7073
7073
  }
7074
- var snapThreshold = this._calcSnapThreshold(flicking.threshold, position, activeAnchor);
7074
+ var snapThreshold = this._calcSnapThreshold(position, activeAnchor);
7075
7075
  var posDelta = flicking.animating ? state.delta : position - camera.position;
7076
7076
  var absPosDelta = Math.abs(posDelta);
7077
7077
  var snapDelta = axesEvent && axesEvent.delta[POSITION_KEY] !== 0 ? Math.abs(axesEvent.delta[POSITION_KEY]) : absPosDelta;
@@ -7158,7 +7158,7 @@ version: 4.11.3-beta.0
7158
7158
  var adjacentAnchor = (_a = posDelta > 0 ? camera.getNextAnchor(anchorAtCamera) : camera.getPrevAnchor(anchorAtCamera)) !== null && _a !== void 0 ? _a : anchorAtCamera;
7159
7159
  return adjacentAnchor;
7160
7160
  };
7161
- __proto._calcSnapThreshold = function (threshold, position, activeAnchor) {
7161
+ __proto._calcSnapThreshold = function (position, activeAnchor) {
7162
7162
  var isNextDirection = position > activeAnchor.position;
7163
7163
  var panel = activeAnchor.panel;
7164
7164
  var panelSize = panel.size;
@@ -7169,7 +7169,7 @@ version: 4.11.3-beta.0
7169
7169
  * |<------>|<------------>|
7170
7170
  * [ |<-Anchor ]
7171
7171
  */
7172
- return Math.max(threshold, isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev);
7172
+ return isNextDirection ? panelSize - alignPos + panel.margin.next : alignPos + panel.margin.prev;
7173
7173
  };
7174
7174
  return SnapControl;
7175
7175
  }(Control$1);
@@ -8395,11 +8395,13 @@ version: 4.11.3-beta.0
8395
8395
  * @return {AnchorPoint | null}
8396
8396
  */
8397
8397
  __proto.findActiveAnchor = function () {
8398
+ var _a;
8398
8399
  var flicking = getFlickingAttached(this._flicking);
8399
- var activeIndex = flicking.control.activeIndex;
8400
- return find$1(this._anchors, function (anchor) {
8401
- return anchor.panel.index === activeIndex;
8402
- });
8400
+ var activePanel = flicking.control.activePanel;
8401
+ if (!activePanel) return null;
8402
+ return (_a = find$1(this._anchors, function (anchor) {
8403
+ return anchor.panel.index === activePanel.index;
8404
+ })) !== null && _a !== void 0 ? _a : this.findNearestAnchor(activePanel.position);
8403
8405
  };
8404
8406
  /**
8405
8407
  * Clamp the given position between camera's range
@@ -12949,7 +12951,7 @@ version: 4.11.3-beta.0
12949
12951
  * Flicking.VERSION; // ex) 4.0.0
12950
12952
  * ```
12951
12953
  */
12952
- Flicking.VERSION = "4.11.3-beta.0";
12954
+ Flicking.VERSION = "4.11.3-beta.1";
12953
12955
  return Flicking;
12954
12956
  }(Component);
12955
12957