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

Change event bug still persists in latest version when initializing pikaday #910

Open
martinbarilik opened this issue May 26, 2021 · 2 comments

Comments

@martinbarilik
Copy link

martinbarilik commented May 26, 2021

This is duplicate from #149 , just wanna make sure you see this, because nobody answered the guy in 2019

The bug still persists, as you can see in filddle https://jsfiddle.net/mArtinko5MB/2hd7nkvL/11/

All my date inputs are already filled with values and every of them has change event listener for noticing changes on form so current state is unworkable

@ConnectGrid
Copy link

Agreed. Being bitten by this bug, too. I can't believe it's persisted for 6 years without any movement. If the date field already has the same date value as assigned by Pikaday, then no change event should be fired since nothing has "changed".

@ConnectGrid
Copy link

ConnectGrid commented Jun 7, 2021

I've solved this with a three-step solution.

  1. Assign a change event listener to the date field. Call Event.stopPropagation() within this event handler.
  2. Initialize Pikaday for that field.
  3. Remove the event handler assigned in Step 1.

This gives us the behavior that we expect.

@live627 live627 mentioned this issue Aug 6, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants