-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Always render DOM for hidden wizard steps #15467
base: 3.x
Are you sure you want to change the base?
Always render DOM for hidden wizard steps #15467
Conversation
I also noted that the hidden See filament/packages/forms/resources/views/components/wizard.blade.php Lines 121 to 125 in ae86b8c
|
@freshleafmedia regarding your latest comment does something need to be changed, I don't follow what is wrong. |
@danharrin It's not causing a problem and doesn't need changing. To explain: I only mention it because it suggests the wizard was built on the assumption that Sorry for the confusion. |
Ah okay, can you remove the redundant filter then please? And are you sure we don't now need to include step data for hidden steps after this change? Also, how does this problem affect Tabs which operates on a similar principle, should hidden tab content be rendered too? |
Yeap tried it. Closes #11084 That being said, it does render the body of hidden steps, so I'm not sure if it's something to consider. For example, if you have something that you do not want to show, it will be visible if you inspect the DOM As you can see, the solutions step is not visible, but you can see the body of that tab in the DOM |
Yeah I think that is an necessary evil |
@freshleafmedia I ran into the same issue and solved it by adding Edit: I just pulled down your repo to test and indeed Haven't tested if it closes #11084 |
Ok I tried @archilex's solution and it does appear to work (also solves #11084 ) Not sure if you want to create another PR with your solution? Anyway, up to you @danharrin but I disagree that it's a necessary evil. You could have a hidden step with sensitive information visible to certain users only that would still be rendered. |
@sprtk-ches sure, if there is an alternative that is preferable. |
@freshleafmedia feel free to update your PR with the alternate fix if you like. Or I can open a separate PR if you prefer. |
@archilex Adding the key seems to work but for the wrong reason, adding The keys are all the same, which is not what is intended. Adding I believe the root of the problem is a conflict of control between Livewire and AlpineJS. By getting Livewire to render all steps up-front AlpineJS is solely responsible for controlling the step visibility. |
@danharrin Are you happy to merge this PR as-is? |
How about adding the step ID into the |
Setting the key doesn't resolve the problem. I have tried The only comment which alluded to safety you dismissed as necessary evil, has that changed? |
@freshleafmedia Dan means to append the step key to the component key: `wire:key="{{ $this->getId() }}.{{ $id }}”. That way livewire is forced to rerender the components but each key is unique. Might want to add “step” in there. You can search the code base and see how this strategy is implemented in other places. |
@archilex Just tried |
@freshleafmedia You're right. Looks like the component key isn't changing between requests. I assumed it was since just adding |
I'm not going to merge in a solution with a random key, it will cause all sorts of problems on re-render |
Description
When applying conditional
hidden()
reactivity to wizard steps you get weird rendering of subsequent steps on previous ones.There is a repro repo here: https://github.com/freshleafmedia/filament-wizard-step-repro
Visual changes
Before
wizard-before-2025-01-29_12.31.31.mp4
After
wizard-after-2025-01-29_12.32.54.mp4
Functional changes
composer cs
command.