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

p-sidebar dimissable flag is not re-evaluated when its value changes #7157

Closed
thaihacong opened this issue Jan 22, 2019 · 0 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@thaihacong
Copy link

thaihacong commented Jan 22, 2019

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/github-qbafbn?file=src%2Fapp%2Fapp.component.html

Current behavior
I have a p-sidebar as follow

<p-sidebar [(visible)]="display" position="right" 
             [dismissible]="!changed"
             [showCloseIcon]="!changed">

When changed flag is updated, only closeIcon is shown/hidden correspondingly, but value of dismissible flag is evaluated only once on initialization.
On my given plunkr, changed = false on init, therefore dismissible = true, user can always click outside to close the sidebar, although changed = true later (on click).

Expected behavior
dismissible flag should be re-evaluated every time its value changed.

Minimal reproduction of the problem with instructions
Click Show/hide sidebar to open sidebar, then click Toggle changed flag and click outside to check if the sidebar is dimissible or not.

What is the motivation / use case for changing the behavior?
I have sidebar as an edit dialog, it should not be dimissible when user has unsaved changes.

  • Angular version: 7.2.0

  • PrimeNG version: 7.0.4

@yigitfindikli yigitfindikli self-assigned this Jan 22, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 23, 2019
@cagataycivici cagataycivici added this to the 7.0.5 milestone Jan 23, 2019
cagataycivici added a commit that referenced this issue Jan 23, 2019
fixed #7157 p-sidebar dimissable flag is not re-evaluated when its va…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants