Datepicker: change event is triggered with `mask=true` when leaving input without changes
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created a year ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Datepicker: Change event is not called when using mask="true"
The behaviour should be the same as the other inputs, the value of the input is changed and the user leaves the field,...
Read more >Jquery datepicker change event trigger and input's default ...
Set your input readOnly , it will help you to change the value of field through icon only. <input type='text' class='inp' readOnly />....
Read more >APEX datepicker return value back without triggerring input's ...
I have a report that contains a date picker, which is generated by ... back without triggerring input's change event when using APEX_ITEM....
Read more >Datepicker not calling ajax "change" on input
Calendar fires "change" when I change the value and leave the field. If I focus the field and leave without modifying it, then...
Read more >Form Datepicker | Components - BootstrapVue
BootstrapVue custom date picker input form control, which provides full ... By default, when no date is selected, the calendar view will be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jan666 here is a reproducer I patched for 12.0.0: pf-9259-patched.zip
Just look in
\src\main\webapp\resources\primefaces
by 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.Works great. Thanks!