primefaces: Datepicker: change event is triggered with `mask=true` when leaving input without changes
Describe the bug
The first time I pick any date the ajax event is called twice, this can be checked through F12 the first ajax sends an empty date, and the second the value picked.
<p:datePicker id="value"
value="#{testView.date}"
mask="true"
pattern="dd/MM/yyyy"
showIcon="true"
showOnFocus="false">
<p:ajax event="change" update="date"/>
</p:datePicker>
Reproducer
Expected behavior
The event should be called just once with the correct value.
PrimeFaces edition
Community
PrimeFaces version
12.0.0.RC3
Theme
No response
JSF implementation
Mojarra
JSF version
2
Java version
2.2.20
Browser(s)
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (10 by maintainers)
Commits related to this issue
- Fix #9259: DatePicker with mask prevent duplicate onChange — committed to melloware/primefaces by melloware 2 years ago
- Fix #9259: DatePicker with mask prevent duplicate onChange (#9263) * Fix #9257: InputNumber set proper hidden input value * Fix #9259: DatePicker with mask prevent duplicate onChange — committed to primefaces/primefaces by melloware 2 years ago
- Revert "Fix #9259: DatePicker with mask prevent duplicate onChange (#9263)" This reverts commit 20b8e5f9856a9773afebf9bee03667e4a149b9a7. — committed to primefaces/primefaces by melloware 2 years ago
- Fix #9259: DatePicker with mask only fire 1 change event — committed to melloware/primefaces by melloware 2 years ago
- Fix #9259: DatePicker with mask only fire 1 change event — committed to melloware/primefaces by melloware 2 years ago
- Fix #9259/#9389: DatePicker with mask only fire 1 change event (#9477) * Fix #9259: DatePicker with mask only fire 1 change event * Fix #9259: DatePicker with mask only fire 1 change event — committed to primefaces/primefaces by melloware 2 years ago
- Fix #10311/#9259: DatePicker remove mask workaround — committed to melloware/primefaces by melloware a year ago
- Fix #10311/#9259: DatePicker remove mask workaround (#10313) — committed to primefaces/primefaces by melloware a year ago
@jan666 here is a reproducer I patched for 12.0.0: pf-9259-patched.zip
Just look in
\src\main\webapp\resources\primefacesby including those two patches JS files at the right location they override the ones found in 12.0.0 because the ones in your WAR take precedence.