Skip to content

Conversation

cklei-carly
Copy link
Collaborator

Fixes incorrect context reference in tree item blade template where $this->getNodeCollapsedState($record) was called from a blade component context where $this doesn't refer to the Livewire component.

Changed to use $tree->getLivewire()->getNodeCollapsedState($record) to properly access the method from the correct Livewire component context.

This enables proper node collapse state functionality for tree items, allowing developers to override getNodeCollapsedState() to control initial tree node visibility (e.g., starting with collapsed nodes).

Fixes #88

Fixes incorrect context reference in tree item blade template where
$this->getNodeCollapsedState($record) was called from a blade component
context where $this doesn't refer to the Livewire component.

Changed to use $tree->getLivewire()->getNodeCollapsedState($record) to
properly access the method from the correct Livewire component context.

This enables proper node collapse state functionality for tree items,
allowing developers to override getNodeCollapsedState() to control
initial tree node visibility (e.g., starting with collapsed nodes).

Fixes #88
@cklei-carly cklei-carly linked an issue Sep 22, 2025 that may be closed by this pull request
@cklei-carly cklei-carly merged commit b5f8264 into 3.x Sep 22, 2025
@cklei-carly cklei-carly deleted the 88-bug-getnodecollapsedstate-didnt-work branch September 22, 2025 04:42
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.

[Bug]: getNodeCollapsedState() didn't work

1 participant