question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to avoid infinite loop of change events

See original GitHub issue

If you have custom config options and add a listener to change events on a flatpickr field, it enters an infinite loop. I can’t figure out why or the best way to avoid or compensate for it. The most basic configuration with no options doesn’t seem to do it, but I want to use some options while triggering events based on the value of the field changing. How can I do this?

Reproduction of the problem: https://jsfiddle.net/y890pmzu/

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
em77commented, Sep 8, 2020

https://stackblitz.com/edit/flatpickr-with-alert-gffekn?file=index.js

Including the allowInput: true option makes it an infinite loop.

0reactions
mattpramschufercommented, Sep 28, 2020

For me I just hooked into the onClose function rather than the onChange

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop infinite looping by limiting the number of trigger ...
How do you limit the number of trigger executions to stop infinite looping during Change Request Transition in Telelogic Change?
Read more >
How can one solve the infinite loop of change events?
EnableEvents = True . This prevents Excel from firing events (like Worksheet_Change) while your code is running.
Read more >
JQuery infinite loops on change event – how to prevent
This can be solved by saving a flag in localStorage. sessionStorage would work fine too, or any others like localdb, etc.
Read more >
How to Avoid Infinite Loops - Disable Events in Excel VBA
Free Workbooks: https://www.excelvbaisfun.com/links?utm_source=youtube&utm_medium=desc&utm_content=Wf7ci_obxaM Join Excel Ninja Pro: ...
Read more >
The Curious Case of Angular and the Infinite Change Event ...
Installation ; Install the Angular CLI globally. npm install -g @angular/cli ; Create a new Angular project. ng new infinite-loop --interactive= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found