Wizard step overflow-y-hidden not hiding child elements from other steps
I'm using the Form Builder with Wizard layout to organize a large form into steps for the user. Step 1 is short, just basic contact info, but steps 2 and 3 are much longer and contain combinations of sections and repeaters.
The issue is on step 1 there is a ton of empty scroll space at the bottom of the page and when inspecting the code, it looks like the elements in steps 2 & 3 are causing this. Doesn't look like
h-0 overflow-y-hidden
is observed. When I replace x-bind:class="{ 'invisible h-0 overflow-y-hidden': step !== @js($getId()) }"
with x-bind:class="{ 'hidden h-0 overflow-y-hidden': step !== @js($getId()) }"
it seems to get rid of the empty space.
So my question is why couldn't we just use hidden/display:none to hide tabs out of focus, or if someone knows a solution or what I am doing wrong that would also be great.
P.S. I am using a custom theme, but I updated to the latest versions of Tailwind and it still happens when I disable the custom theme.12 Replies
interesting
@zepfietje @awcodes do you know the reason we use invisible instead of hidden here?
Not sure. Haven’t done much with the wizard. I’m wondering if it has something to do with auto focus on validation or the step index?
oh, i dont think its the autofocus
I've tested validation and form submission using
hidden
instead, and it seems to work. Is invisible
being used for transition purposes?That’s a possibility too. I’m seeing the tabs also uses it, so there has to be a valid reason.
I've, so far, tried skippable and the validation hooks (trying to break it) but seems to be working still.
Found this: https://github.com/filamentphp/filament/pull/1997/files, maybe FilePond?
GitHub
Fix file upload not loading correctly in secondary tabs and collaps...
Fixes #1967
Replaces x-show with a custom set of classes that hide the tabs without using display: none. This is the workaround proposed in the FilePond issue (pqina/filepond#819 (comment)).
Nope, still works 🤷♂️
Can you try it with a tabs form field too?
I set this up quickly as a test.
overflow-y-hidden
seems to work on tabs. I also noticed that Wizard doesn't make use of wire:key
but tabs do. I'm also going through all of my columnSpans and columns values to see if I have any unclosed divs or somethingHmm not sure, @danharrin, but I was thinking the same as @awcodes
i dont think we can eaisly switch to hidden or x-show because of the github issue linked above, so will need to continue investigating how to get this to work properly with invisible
I've seen this approach in other places where it does seem to ignore the invisible height?