DatePicker: onchange event called twice using touchUI="true"
See original GitHub issueDescribe the bug
When editing a cell with a datepicker in it, currentCell
property returns null only on an iPhone
This is due to on onchange
event being called twice and resetting currentCell
to null
This can also be reproduced on Safari (Mac/Desktop) Developer Tools by impersonating iPhone actual iPhone is not necessary.
Reproducer
Workaround:
onchange="var bt = PF('birthdayTable');
if (bt.currentCell) bt.saveCell(bt.currentCell)"
Expected behavior
onchange
event would be called only once
or
currentCell
would be non-null the second time on both iPhone and other browsers
PrimeFaces edition
Community
PrimeFaces version
12.0.0RC3, 12.0.0
Theme
Default
JSF implementation
Mojarra
JSF version
2.3
Java version
8 through 19
Browser(s)
Safari on iPhone
Issue Analytics
- State:
- Created a year ago
- Comments:26 (14 by maintainers)
Top Results From Across the Web
jQuery change event being fired twice - Stack Overflow
Problem is my bootstrap datepicker change event fire two times. The trick is to use changeDate instead of change.
Read more >datepicker change event fired twice. #1233 - GitHub
In repo vizjerai/bootstrap-datepicker. This issue is fixed like this. Fix multiple calls to change #4 commit How is going at this repo?
Read more >OnChange called twice | Telerik Forums
The request calls SingleUpdate action method where I use Reflection, the propertyName and the new value to update a value in my business...
Read more >Why Type Ahead Text Control logs onChange Event twice if ...
I'm using Type Ahead Text Control from IBM BPM UI toolkit ; I notice it logs onChange Event twice if an item is...
Read more >Solved: Onchange event often triggers when screen becomes
Solved: Greetings PowerAppers, I have a date picker control on an edit form in an app I am finishing up. The form and...
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
I have narrowed the bug down to this. When it switched from regular to touchUI mode the click events get registered twice.
if I comment out this line they are only registered once but the wrong thing is happening.
So even though I am calling
off
before rebinding events the delegated click is still being registered.I fixed the NULL check in
saveCell
but still haven’t found a solution for the double mapping ofclick
events.