-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p-calendar closes when clicking previous or next month from within editable table cell #7441
Comments
I found this issue happening in Android Chrome device even if the p-calendar is not within turbo table editable cell. Issue can be reproduced in official site.
We also downgrade our version to 6.1.4 and it's working normally |
I am having this same issue within a reactive form on Angular 7.2.13 and primeng 7.1.1. The inputs that I am providing are id, monthNavigator, yearNavigator, yearRange, and formControlName |
Downgrading to 6.1.4 like @theojinchiu mentioned did the trick. The highest version I didn't have this issue in was 6.1.7 |
Any news on this ? |
It seems like the issue is fixed with version 7.1.1, I tested it on the official site. Can you guys confirm with your case also? |
@theojinchiu 7.1.1 is the version that I am having issues with. |
@theojinchiu, I may have been wrong in my last comment, I am still having the problem in my code, but not if I run a fork of the main branch on here. I am attempting to find out why that is now. |
Fwiw, when tested on an empty component I can only reproduce this issue with version 7.1.1 |
I'm on primereact 3.1.2 and have exactly the same issue (used as datepicker from table cell). |
Looks like this issue is fixed in #7566 and will be released in 7.1.2 |
I was having this problem with a p-calendar in a drawer. Figured out that it was registering the month changing clicks as "outside of the drawer" which then closed the drawer. Fixed it by adding additional logic to the onCancel method (that got called when a click "outside of the drawer" was registered) to have the event passed in as optional so these clicks outside of drawer passed no event and the drawer didn't close if it had nothing passed |
Issue persits in 7.1.3. having p-calendar within a turbotable cell causes the overlay to close upon switching months:
|
I suggested a sollution on #7384 |
Can share the code |
It's not being fixed. still, I am facing the issue |
I found the solution: you need to use a stop click propagation system. I created a directive:
Use it like this
|
Hi @rogiermulders,
Could you please create an issue in PrimeReact Github? Best Regards, |
I am facing the same issue, Could you please provide the code snippet. |
Alas, I cannot. I no longer have access to the codebase in question, and my memory remains unfortunately average. Good luck! |
To combine this technique with the solution for the problem described on issue #1818, one will have to use the following template: <!-- Apply stop-click-propagation here to solve the click propagation bug: -->
<div
#calendarWrapper
stop-click-propagation
>
</div>
<p-table
[value]="cars"
editMode="row"
dataKey="identifier"
>
<!-- ... -->
<ng-template pTemplate="body" let-car let-editing="editing">
<!-- ... -->
<td pEditableColumn>
<p-cellEditor>
<ng-template pTemplate="input">
<!-- Add [appendTo] to solve the CSS conflict with p-table: -->
<p-calendar
[(ngModel)]="car.manufacturingDate"
[appendTo]="calendarWrapper"
>
</p-calendar>
</ng-template>
<ng-template pTemplate="output">
{{car.manufacturingDate}}
</ng-template>
</p-cellEditor>
</td>
<!-- ... -->
</ng-template>
</p-table> |
this issue is still there when we use p-calendar with editable cell (p-treeTableCellEditor) in p-treeTable i found that this occur due the appendTo="body" config that i add inside the p-calendar |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng7-calendar-check
Current behavior
p-calendar closes when clicking the previous or next month buttons when in a editable cell within a turbo table.
Expected behavior
Ability to navigate to different months without the calendar dialog closing.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/primeng7-calendar-check
Basic instructions and steps to reproduce are outlined within the stackblitz link. In summary, a basic input is shown with p-calendar working as expected, however the p-calendar within an editable table cell closes as soon as a month is clicked.
What is the motivation / use case for changing the behavior?
This was working prior to major version 7 and I verified that it does work in 6.1.7 today by downgrading our project.
Please tell us about your environment:
Win10, VS Code
Angular version:
7.2.8
PrimeNG version:
7.1.0
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome 73.0.3683.75, IE 11
Language: [all | TypeScript X.X | ES6/7 | ES5]
Typescript 3.2.4
Node (for AoT issues):
node --version
= 10.15.3The text was updated successfully, but these errors were encountered: