Skip to content

fix: Add support for customizable tree key in SelectTree #154

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

Merged
merged 3 commits into from
Apr 12, 2025

Conversation

mgkimsal
Copy link
Contributor

@mgkimsal mgkimsal commented Apr 6, 2025

Introduce a treeKey property and associated methods to allow customization of the tree identifier. Updated Blade template to use the specified tree key for the wire:key attribute to ensure predictable component rendering.

This is to address issue #141

Introduce a `treeKey` property and associated methods to allow customization of the tree identifier. Updated Blade template to use the specified tree key for the `wire:key` attribute to ensure predictable component rendering.

This is to address issue CodeWithDennis#141.
@mgkimsal
Copy link
Contributor Author

mgkimsal commented Apr 6, 2025

well... after more testing, this still seems to not work on first render. whatever issue is causing that is still an issue. but the rerendering issue where the select box would disappear is fixed with this.

Updated the `FilamentView::hasSpaMode` method to include the current URL as a parameter. This ensures the SPA mode condition is evaluated more precisely based on the current context.
@mgkimsal
Copy link
Contributor Author

mgkimsal commented Apr 6, 2025

Added current url in the spaMode check to allow the spaUrlExceptions to work correctly. Were not working for me until this.

Updated the treeKey property to use a dynamic default value, ensuring more flexibility. Also adjusted the setUp method to initialize treeKey with a randomized suffix for uniqueness.
@mgkimsal
Copy link
Contributor Author

@CodeWithDennis - per your comment in the other PR, I think this one is 'ready' for you to take, as it took feedback from @neverything on the 'default to rand'. This defaults to a default string key with rand value appended (in setup).

And this has a fix for 'spa' check to evaluate based on the current url.

@CodeWithDennis
Copy link
Owner

Thanks! @mgkimsal @neverything

@CodeWithDennis CodeWithDennis merged commit 64f99b5 into CodeWithDennis:3.x Apr 12, 2025
1 check passed
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.

None yet

2 participants