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

primefaces-test-master.zip

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

Most upvoted comments

@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.