Skip to content

Conversation

@Coderxrohan
Copy link
Contributor

Fix Calendar onInput when mask is enabled

Problem

When the mask prop is used, Calendar routes user typing through
updateValueOnInput() but does not forward the native onInput event.
As a result, props.onInput never fires when mask is enabled.

Solution

Forward props.onInput(event) inside updateValueOnInput, ensuring
consistent behavior between masked and unmasked Calendar inputs.

Result

  • onInput fires correctly with mask
  • No behavior change without mask
  • No breaking API changes

Fixes #7640 (Calendar: With "mask", not work callback "onInput")

@Coderxrohan
Copy link
Contributor Author

@melloware
I was able to resolve this third bug quickly (within a day) since it was located in the same Calendar file as another high-priority issue I was already working on. I was also personally affected by this behavior, which made it easier to identify the root cause and apply the fix efficiently.

Please let me know if you’d like any refinements or adjustments.

@Coderxrohan
Copy link
Contributor Author

Coderxrohan commented Jan 1, 2026

Working on (and one that also affected me), I was able to quickly understand & fix it.
#8457 Fix Calendar displaying value when controlled state is not updated

@x10vaishnavi
Copy link

@Coderxrohan
Yes, The issue is now resolved and working as expected.
The fix has been implemented and verified locally. I’ve tested the affected Calendar scenarios, and the onInput behavior is now consistent with controlled state updates.

Thanks for this fix, as this issue caused me to panic for some time.

@melloware melloware force-pushed the fix/calendar-mask-oninput branch from abcf6a4 to 7908941 Compare January 2, 2026 12:06
@melloware melloware merged commit f9ea8f3 into primefaces:master Jan 2, 2026
2 checks passed
@Coderxrohan
Copy link
Contributor Author

Coderxrohan commented Jan 2, 2026

Thanks @melloware
For taking care of the refactor and final adjustments.
I appreciate you stepping in to align the useEffect structure and helping get this merged so quickly. 🙏

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.

Calendar: With "mask", not work callback "onInput"

3 participants