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

Changing Configs Dynamically Does Not Reflect The Changes #126

Open
justwellsolets opened this issue Dec 15, 2023 · 2 comments
Open

Changing Configs Dynamically Does Not Reflect The Changes #126

justwellsolets opened this issue Dec 15, 2023 · 2 comments

Comments

@justwellsolets
Copy link

Describe the bug
The config works fine when it was set at initial at time of initializing the component, But it does not work when it was set dynamically.

For example:
It works fine:
public config = {
allowInput: true,
enableTime: true,
time_24hr: false,
maxDate: new Date(),
};

But this does not work:
public config;

updateConfig() {
this.config = {
allowInput: true,
enableTime: true,
time_24hr: false,
maxDate: new Date(),
}
}

Reproduction
Issue can be easily reproduced here stackblitz

Expected behavior
Flatpickr should be updated with the latest config value.

Desktop (please complete the following information):

  • OS: Windows 11 Pro
  • Browser: Chrome
  • Version: 120.0.6099.71

Additional context
Any suggestions would be highly appreciated.

@finitha
Copy link

finitha commented Jan 22, 2024

Hey,
I have the same issue.
Did you find a solution ?

@justwellsolets
Copy link
Author

Hello @finitha,
I explored the official flatpickr library and observed that the maintainers are inactive.

You can find a fork of the official flatpickr library here. I made some changes to the source code to support dynamic configuration and opened a pull request (PR), which you can track here. More information about the changes can be found in the PR description.

I encourage additional contributions to assist in publishing, maintaining and enhancing this fork.
https://github.com/justwellsolets/flatpickr-ng

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