Skip to content
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

Size of p-inputSwitch in a dialog #576

Closed
Elanor-L opened this issue Jul 7, 2016 · 3 comments
Closed

Size of p-inputSwitch in a dialog #576

Elanor-L opened this issue Jul 7, 2016 · 3 comments

Comments

@Elanor-L
Copy link

Elanor-L commented Jul 7, 2016

When in a dialog, the width of the button is only 6px. I tried the following workaround
<p-dialog (onAfterShow)="dialogInitialized = true"> <p-inputSwitch *ngIf="dialogInitialized"></p-inputSwitch> </p-dialog>
but I got this error

ORIGINAL EXCEPTION: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'

@garethlewis
Copy link

That isn't a bug with Prime, this is the Angular detection framework. Your value of dialogInitialized is changing. When Angular is creating the component, it is using default value for dialogInitialized in the ngIf statement. The code in onAfterShow is then run and changes the value to true, the detection listener then looks again and realises that the values has changed, but it didn't change in a binding. So it throws this as an error. There are ways around it, one of the simplest is to put Angular into production mode and this check is not performed.

@sievert
Copy link

sievert commented Jul 8, 2016

dublicates #455

@cagataycivici
Copy link
Member

Fixed via #972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants