@egjs/flicking 4.9.0 → 4.9.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.
@@ -60,7 +60,7 @@ declare class Panel {
60
60
  markForHide(): void;
61
61
  resize(cached?: {
62
62
  size: number;
63
- height: number;
63
+ height?: number;
64
64
  margin: {
65
65
  prev: number;
66
66
  next: number;
@@ -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.9.0
7
+ version: 4.9.1
8
8
  */
9
9
  import Component, { ComponentEvent } from '@egjs/component';
10
10
  import Axes, { PanInput } from '@egjs/axes';
@@ -5482,11 +5482,13 @@ function () {
5482
5482
  } : {
5483
5483
  height: panelSize
5484
5484
  };
5485
- var firstPanelSizeObj = {
5485
+
5486
+ var firstPanelSizeObj = __assign({
5486
5487
  size: panelSize,
5487
- height: referencePanel.height,
5488
5488
  margin: referencePanel.margin
5489
- };
5489
+ }, !flicking.horizontal && {
5490
+ height: referencePanel.height
5491
+ });
5490
5492
 
5491
5493
  if (!flicking.noPanelStyleOverride) {
5492
5494
  this._strategy.updatePanelSizes(flicking, panelSizeObj);
@@ -6020,6 +6022,8 @@ function () {
6020
6022
 
6021
6023
 
6022
6024
  __proto.resize = function (cached) {
6025
+ var _a;
6026
+
6023
6027
  var el = this.element;
6024
6028
  var flicking = this._flicking;
6025
6029
  var horizontal = flicking.horizontal,
@@ -6028,7 +6032,13 @@ function () {
6028
6032
  if (cached) {
6029
6033
  this._size = cached.size;
6030
6034
  this._margin = __assign({}, cached.margin);
6031
- this._height = cached.height;
6035
+ this._height = (_a = cached.height) !== null && _a !== void 0 ? _a : getElementSize({
6036
+ el: el,
6037
+ horizontal: false,
6038
+ useFractionalSize: useFractionalSize,
6039
+ useOffset: true,
6040
+ style: getStyle(el)
6041
+ });
6032
6042
  } else {
6033
6043
  var elStyle = getStyle(el);
6034
6044
  this._size = getElementSize({
@@ -8474,9 +8484,10 @@ function (_super) {
8474
8484
  var renderer = this._renderer;
8475
8485
  var control = this._control;
8476
8486
  var camera = this._camera;
8477
- var initialPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
8478
- if (!initialPanel) return;
8479
- var nearestAnchor = camera.findNearestAnchor(initialPanel.position);
8487
+ var defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
8488
+ if (!defaultPanel) return;
8489
+ var nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
8490
+ var initialPanel = nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index ? nearestAnchor.panel : defaultPanel;
8480
8491
  control.setActive(initialPanel, null, false);
8481
8492
 
8482
8493
  if (!nearestAnchor) {
@@ -8537,7 +8548,7 @@ function (_super) {
8537
8548
  */
8538
8549
 
8539
8550
 
8540
- Flicking.VERSION = "4.9.0";
8551
+ Flicking.VERSION = "4.9.1";
8541
8552
  return Flicking;
8542
8553
  }(Component);
8543
8554