@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egjs/flicking",
3
- "version": "4.9.0",
3
+ "version": "4.9.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",
@@ -23,7 +23,7 @@
23
23
  "test": "npm run test --prefix test/unit",
24
24
  "test:chrome": "npm run test:chrome --prefix test/unit",
25
25
  "test:cfc": "npm run test --prefix test/cfc",
26
- "lint": "eslint 'src/**/*.ts'",
26
+ "lint": "eslint src/**/*.ts",
27
27
  "lint:test": "eslint 'test/unit/**/*.ts'",
28
28
  "jsdoc": "jsdoc -c jsdoc.json",
29
29
  "jsdoc:watch": "npm-watch jsdoc",
@@ -136,7 +136,7 @@
136
136
  "typescript-transform-paths": "^2.2.3"
137
137
  },
138
138
  "dependencies": {
139
- "@egjs/axes": "^3.2.2",
139
+ "@egjs/axes": "^3.4.0",
140
140
  "@egjs/component": "^3.0.1",
141
141
  "@egjs/imready": "^1.1.3",
142
142
  "@egjs/list-differ": "^1.0.0"
package/src/Flicking.ts CHANGED
@@ -1502,11 +1502,12 @@ class Flicking extends Component<FlickingEvents> {
1502
1502
  const renderer = this._renderer;
1503
1503
  const control = this._control;
1504
1504
  const camera = this._camera;
1505
- const initialPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
1505
+ const defaultPanel = renderer.getPanel(this._defaultIndex) || renderer.getPanel(0);
1506
1506
 
1507
- if (!initialPanel) return;
1507
+ if (!defaultPanel) return;
1508
1508
 
1509
- const nearestAnchor = camera.findNearestAnchor(initialPanel.position);
1509
+ const nearestAnchor = camera.findNearestAnchor(defaultPanel.position);
1510
+ const initialPanel = (nearestAnchor && defaultPanel.index !== nearestAnchor.panel.index) ? nearestAnchor.panel : defaultPanel;
1510
1511
  control.setActive(initialPanel, null, false);
1511
1512
 
1512
1513
  if (!nearestAnchor) {
@@ -308,7 +308,7 @@ class Panel {
308
308
  */
309
309
  public resize(cached?: {
310
310
  size: number;
311
- height: number;
311
+ height?: number;
312
312
  margin: { prev: number; next: number };
313
313
  }): this {
314
314
  const el = this.element;
@@ -321,7 +321,13 @@ class Panel {
321
321
  if (cached) {
322
322
  this._size = cached.size;
323
323
  this._margin = { ...cached.margin };
324
- this._height = cached.height;
324
+ this._height = cached.height ?? getElementSize({
325
+ el,
326
+ horizontal: false,
327
+ useFractionalSize,
328
+ useOffset: true,
329
+ style: getStyle(el)
330
+ });
325
331
  } else {
326
332
  const elStyle = getStyle(el);
327
333
 
@@ -496,8 +496,8 @@ abstract class Renderer {
496
496
  : { height: panelSize };
497
497
  const firstPanelSizeObj = {
498
498
  size: panelSize,
499
- height: referencePanel.height,
500
- margin: referencePanel.margin
499
+ margin: referencePanel.margin,
500
+ ...(!flicking.horizontal && { height: referencePanel.height})
501
501
  };
502
502
 
503
503
  if (!flicking.noPanelStyleOverride) {
package/TODO.md DELETED
@@ -1,3 +0,0 @@
1
- ## React 18 대응
2
- - [] updateoffset을 미루기
3
- - render가 완료되기 전에 updateOffset이 3번 호출되었음