p-calendar in editable p-table behaviour bug
Current Queue Time for Review Without PRO Support: ~8-12 weeks. With PRO Support: 1 hour
I'm submitting a ... (check one with "x")
[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports) https://stackblitz.com/edit/primeng-tableedit-demo-6xzcg8
Current behavior
Given an editing table with a p-calendar (with pEditableColumn and p-cellEditor).
When you're trying to select a date .
And you click on the month (or the year).
Then the dropdown doesn't pop up and the field turns back into "output" mode

Expected behavior
The month dropdown should appears and the field should stay on "input" mode
What is the motivation / use case for changing the behavior? I have a table to manage projects with order reception date, and some other dates to edit.
Please tell us about your environment: Visual studio code, Windows
-
Angular version: 9.1.9
-
PrimeNG version: 9.2.1
-
Browser: [all]
- Language: [all]
Ok @yigitfindikli I just found this issue https://github.com/primefaces/primeng/issues/7441 But this solution that doesn't seems to work for me https://github.com/primefaces/primeng/issues/7441#issuecomment-508677945
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!
Best Regards,
With version 9, this fix is working :
<p-calendar
(onFocus)="onFocus($event)"
></p-calendar>
onFocus(evt) {
setTimeout(function(){
const selectDatePickerMonth:any = document.getElementsByClassName("ui-datepicker-month");
if(selectDatePickerMonth.length==1) {
const elem = selectDatePickerMonth[0];
elem.addEventListener('click',
function(evt){
evt.stopImmediatePropagation();
}, false);
}
const selectDatePickerYear:any = document.getElementsByClassName("ui-datepicker-year");
if(selectDatePickerYear.length==1) {
const elem = selectDatePickerYear[0];
elem.addEventListener('click',
function(evt){
evt.stopImmediatePropagation();
}, false);
}
}, 250);
}
PS: The function onShow is documented but not implemented, then I used onFocus with a little delay to let the panel be visible.