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

NEXT-38027 - fix datepicker not emiting value when manually entered #270

Merged

Conversation

tajespasarela
Copy link
Contributor

What?

This MR fixes an issue with the mt-datepicker, that provokes not saving the date when it is typed manually instead of selected from the calendar.

How?

The solution was to emit the changed value also in the onClose hook of the flatpicker component. This way when user clicks save, it will be emitted.

There is another hook onValueUpdate but this is emitted multiple times when typed and it is not emitted when the date is deleted manually. So the onClose hook works better.

It was also necessary to update the flatpickr dependency to latest version to fix some inconsistent behaviour.

Testing?

  • go to Should emit date value when manually typed in storybook

Copy link

vercel bot commented Aug 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
meteor-component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 0:22am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
meteor-admin-sdk-docs ⬜️ Ignored (Inspect) Visit Preview Sep 11, 2024 0:22am

@tajespasarela tajespasarela force-pushed the next-38027/fix-datepicker-not-emit-value-entered-manual branch from e5dc952 to 922b799 Compare August 30, 2024 09:31
Copy link

pkg-pr-new bot commented Aug 30, 2024

commit: 922b799

pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-admin-sdk@270
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-component-library@270
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-icon-kit@270
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-tokens@270

Open in Stackblitz

Copy link
Collaborator

@Haberkamp Haberkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog by using npx changesets

@tajespasarela
Copy link
Contributor Author

tajespasarela commented Sep 3, 2024

Please add a changelog by using npx changesets

done

@Haberkamp Haberkamp merged commit 307439b into main Sep 11, 2024
8 checks passed
@Haberkamp Haberkamp deleted the next-38027/fix-datepicker-not-emit-value-entered-manual branch September 11, 2024 13:04
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

Successfully merging this pull request may close these issues.

3 participants