primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Calendar doesnt play well with OnPush change detection strategy

Open external-olgierd opened this issue 9 years ago • 5 comments

I'm submitting a ...

[x ] bug report => Search github for a similar issue or PR before submitting

http://plnkr.co/edit/i58dTl1dQgrNmKQedcT5?p=preview

Current behavior When is used within the component with OnPush change detection strategy, the closing of the datepicker popup is not working as expected:

  • datepicker is not closing when date is selected (need to click twice)
  • datepicker is not closing when focus is lost from the input field/when user clicks anywhere else on the screen

Expected behavior Datepicker is closed when date is selected or when user clicks anywhere else on the screen.

Minimal reproduction of the problem with instructions It affects any component that is added to the component with OnPush change detection strategy. See the above plunker.

What is the motivation / use case for changing the behavior? OnPush change detection strategy is widely used in Angular2 apps for performance reasons so Calendar component should behave correctly in these cases.

Angular version: 2.0.0 and above (incl. most recent one)

PrimeNG version: 2.0.1

Browser: all

external-olgierd avatar Feb 24 '17 14:02 external-olgierd

Autocomplete component behaves in a similar way too.

alialtun14 avatar Mar 04 '17 00:03 alialtun14

@alialtun14 I suggest you log a new issue with relevant plunkr for autocomplete component. Probably the best way to get it fixed quickly.

external-olgierd avatar Mar 06 '17 08:03 external-olgierd

@alialtun14 I'm running into the same issue with the autocomplete component, have created this issue for it: https://github.com/primefaces/primeng/issues/2226

variable-content avatar Mar 07 '17 04:03 variable-content

Thank you.

On Tue, Mar 7, 2017 at 5:47 AM, Steve [email protected] wrote:

@alialtun14 https://github.com/alialtun14 I'm running into the same issue, have created this issue for it: #2226 https://github.com/primefaces/primeng/issues/2226

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/primefaces/primeng/issues/2148#issuecomment-284620818, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvvdAANk9N_nYAfl2FlqU-CWYf8K7dnks5rjOFmgaJpZM4MLQmM .

alialtun14 avatar Mar 07 '17 06:03 alialtun14

Hi everyone, Hi @cagataycivici

I'm still having this issue on 2.0.6...

I have a calendar that I don't have any issue firing the focus event, however, the calendar consistently requires two clicks to select a date.

I did notice that the calendar css classes goes from having ui-inputwrapper-focus class to not having it on the first click, but only the second does actually change something and makes the onSelect event fire.

Wasn't this issue supposed to fix that?

EDIT

Also, I don't specify a change detection method

SOLVED

My issue was probably not related to this. See #2378

CelsoSantos avatar Jun 19 '17 21:06 CelsoSantos