naver/egjs-flicking

how to update option dynamically, and Cannot read properties of null (reading 'offsetX') if you trigger any event except click

marko-mlinarevic opened this issue · 1 comments

I need to update alignment from prev to center after first change of panel. Is that possible, I was able to change in camera and panel but calculations are still wrong even with $forceUpdate() and resize() options

this is what I'm doing currently

e.currentTarget.panels.forEach( ( panel ) => {
  panel.align = 'center';
} );
e.currentTarget.camera.align = 'center';
e.currentTarget.camera.updateAlignPos();

EDIT: One thing I noticed if you trigger moveToPosition but the event(example @pointerup) you gain error Uncaught (in promise) TypeError: Cannot read properties of null (reading 'offsetX') at __proto.onChange (chunk-TZM2WP5A.js?v=d192554c:5067:51) at __proto.fire (chunk-TZM2WP5A.js?v=d192554c:5302:22) at chunk-TZM2WP5A.js?v=d192554c:5518:29 at chunk-TZM2WP5A.js?v=d192554c:93:9 at Array.forEach (<anonymous>) at __proto.trigger (chunk-TZM2WP5A.js?v=d192554c:92:16) at __proto.triggerChange (chunk-TZM2WP5A.js?v=d192554c:1095:16) at loop_1 (chunk-TZM2WP5A.js?v=d192554c:2151:46) at __proto._animateLoop (chunk-TZM2WP5A.js?v=d192554c:2166:7) at __proto.animateTo (chunk-TZM2WP5A.js?v=d192554c:2062:12)

Error is at this line:

    var offset = flicking.horizontal ? inputEvent.offsetX : inputEvent.offsetY;

Hello @marko-mlinarevic.

We would like to check about the implementation you want.
If you want to change the alignment overall, can you try changing the align option of a Flicking instance by directly changing e.currentTarget.align?