Skip to content

fix(Sidebar): apply input changes after first render, scope state actions to their sidebar - #307

Merged
xidedix merged 1 commit into
v5.7from
fix/sidebar-state
Oct 16, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/sidebar-state

Conversation

@xidedix

@xidedix xidedix commented Oct 16, 2026

Copy link
Copy Markdown
Member

Sidebar ignored input changes after first render, and internal actions leaked to other sidebars.

  • ngOnChanges looked for visible, narrow, unfoldable; with signal inputs SimpleChanges carries visibleInput, narrowInput, unfoldableInput. [visible] false to true left hide and inert; first unfoldable toggle after an [unfoldable] change did nothing. SimpleChanges<SidebarComponent> now fails the build when an *Input field is renamed. An init flag replaces firstChange, so the first setInput() after render applies too.
  • Actions carrying a sidebar reference (init, layout change, backdrop click, nav link on mobile) reached every sidebar without id (undefined === undefined); a second id-less sidebar's init state hid the first. Now they reach that sidebar only, also when they carry an id. Actions without sidebar still match by id.
  • An action without visible no longer changes visibility: a [narrow] change hid an open overlaid sidebar bound with [(visible)]. A sidebar clears the shared backdrop only when it was the open one, so an input change on a closed mobile sidebar keeps another sidebar's backdrop.

Each fix has a spec that fails before it; three more specs guard behaviour that already worked. Manual check, sidebar docs examples (static inputs) with the patch built into pro: same classes and togglers at 1400 and 500 px.

…ions to their sidebar

- ngOnChanges matched alias keys; SimpleChanges carries visibleInput/narrowInput/unfoldableInput, so [visible] left hide + inert. Keys typed via SimpleChanges<SidebarComponent>; ngOnInit flag replaces firstChange, first setInput() after render applies.
- Actions with a sidebar reference (init, layout, backdrop, mobile nav link) reached every id-less sidebar; now only that sidebar. Actions without one still match by id.
- Action without visible keeps visibility; sidebar clears the shared backdrop only when it was the open one.
@xidedix
xidedix merged commit fd8d8f9 into v5.7 Oct 16, 2026
9 checks passed
@xidedix
xidedix deleted the fix/sidebar-state branch October 16, 2026 15:02
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

Successfully merging this pull request may close these issues.

1 participant