Is there a way to get current step number in Form Wizard?
I have the following piece of code
I want to make it such that I can do something like this (Continue button to be full width if it is the 1st step)
I tried to inject Component $livewire to the ->nextAction() method but it I got error as it is injecting the parent livewire component, not the form wizard livewire component
7 Replies
bump!
ok. i figured it out (injecting $component) But i haven't figure out how to get the button to be full width yet
extraInputAttributes w-full too?
yea doesn't work.
I also tried
flex-auto
grow
w-full
min-w-full
basis-full
Only way i can get it to work is remove "flex" from the parent div in the browser dom. But that is outside of extraAttributes()
the parent div of the Next action button is this
if i remove flex through browser dom it works (The next button become full width), but that's not a working solution obviously
The Next button html itself through the browser dom. my w-full is applied
bump
I have a similar issue with needing the step number. Could you share your solution for finding
$currentStepNumber
with livewire (injecting $component) ?Here u go (in exchange, do you know the answer to make the next button full width?)
Thank you! Looking into this. Ik it's not best practice but have you tried style instead of class?
->extraAttributes([
'style' => 'width: 100%;',
])
width: 100% doesn't work either. The only thing that work so far is something like width: 600px; or w-96. But that is specific width.
If only i can remove the flex class in the parent div