Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marko-mlinarevic opened this issue Jul 19, 2024 · 1 comment
Assignees
Labels
🔖4.x v4.x~ related issue ❓Question Asking question about @egjs/Flicking

Comments

@marko-mlinarevic
Copy link

marko-mlinarevic commented Jul 19, 2024

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;
@marko-mlinarevic marko-mlinarevic changed the title In vue 3 version of Component how to update option dynamically how to update option dynamically, and Cannot read properties of null (reading 'offsetX') if you trigger any event except click Jul 20, 2024
@malangfox malangfox self-assigned this Jul 26, 2024
@malangfox malangfox added 🔖4.x v4.x~ related issue ❓Question Asking question about @egjs/Flicking labels Jul 26, 2024
@malangfox
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔖4.x v4.x~ related issue ❓Question Asking question about @egjs/Flicking
Projects
None yet
Development

No branches or pull requests

2 participants