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

Fix #6791: apply year change in Calendar when input changed #6794

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

KumJungMin
Copy link
Contributor

Defect Fixes


how to resolve

Related Issue and PR

previous issue capture

스크린샷 2024-06-26 오후 9 08 12 스크린샷 2024-06-26 오후 9 08 05

previous pr
스크린샷 2024-06-26 오후 9 09 57



how to resolve

  • Whether the calendar picker is visible or not, the date should be updated.
  • So, I deleted !visible condition in useUpdateEffect hook. :)
// before
useUpdateEffect(() => {
	if (!visible && newDate) { ... } 
    ...
})
// after
useUpdateEffect(() => {
	if (!newDate) return;
    ...
})

result

  1. you can change date value using external button.(previous issue)
previous.mov
  1. you can change date value using date input.
next.mov

Copy link

vercel bot commented Jun 26, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 0:22am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 0:22am

@@ -3070,29 +3070,29 @@ export const Calendar = React.memo(
isTypingRef.current = false;

// #3516 view date not updated when value set programatically
if (!visible && newDate) {
Copy link
Member

Choose a reason for hiding this comment

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

You remove the !visible check?

also did you retest ticket #3516 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted !visible condition and changed to early return :)
I checked the #3516 ticket, It works as shown in the video below

2024-06-26.9.42.54.mov

@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label Jun 26, 2024
Copy link
Member

@melloware melloware left a comment

Choose a reason for hiding this comment

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

Nice!

@melloware melloware merged commit 0c155da into primefaces:master Jun 26, 2024
6 checks passed
@KumJungMin KumJungMin deleted the fix/issue-6781 branch June 26, 2024 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar: Manual Typing doesn't update the year on the top
2 participants