Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

"Expression Has Changed" error when autoCollapseWidth is set and [(opened)] is true #204

Closed
joekaiser opened this issue May 16, 2020 · 3 comments

Comments

@joekaiser
Copy link

joekaiser commented May 16, 2020

Create a sidebar and set [(opened)]="sidebarOpen" autoCollapseWidth="860". If the page loads when sidebarOpen = true and and the browser width is <860, then angular throws a "Expression has changed after it was checked" error. If the browser width is >860 then the error goes away.

Obviously, this is because opened is clashing with the auto collapse feature. Is there a known workaround for this? What I am looking to do is to have the sidebar shown by default, but if the page loads and the width is too small then it should be collapsed.

I have created a simple reproduction here https://codesandbox.io/s/ng-sidebar-error-pvr4e

Check the console for the error

@joekaiser joekaiser changed the title "Expression Has Changed" error when autoCollapseWidth is set [(opened)] is true "Expression Has Changed" error when autoCollapseWidth is set and [(opened)] is true May 16, 2020
@joekaiser
Copy link
Author

joekaiser commented May 28, 2020

@arkon I saw your comment here. #203 (comment) Is this repo still supported?

@arkon arkon closed this as completed in bb20a2e May 30, 2020
@arkon
Copy link
Owner

arkon commented May 30, 2020

Is this repo still supported?

Barely. :)

I pushed out something that might help.

@joekaiser
Copy link
Author

Thanks for the effort, but the bug still exists. See https://codesandbox.io/s/ng-sidebar-error-pvr4e for a demo.

Maybe i'll take a shot and do a PR

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

No branches or pull requests

2 participants