enisn / Xamarin.Forms.InputKit

CheckBox, Radio Button, Labeled Slider, Dropdowns etc.
MIT License
589 stars 100 forks source link

Can submit button be used in a frame on a formview? #345

Open MarkLFT opened 1 year ago

MarkLFT commented 1 year ago

My Question Here ?

I am using a FormView, as the form is quite long, I want to display it in small cards. I am using Frames to group blocks of inputs, but if I try to put the Submit button into a frame for aesthetic purposes, it no longer triggers the command defined using the FormView submit command. Is this by design or am I just doing something wrong?

<input:FormView SubmitCommand="{Binding SubmitCommand}"
                    IsValidated="{Binding IsValidated}"
                    Spacing="10">
<Frame>
<Button Text="Save" input:FormView.IsSubmitButton="True"/>
</Frame>
</input:FormView>
enisn commented 1 year ago

Yeah, it should be working since it looks or it recursively. If it doesn't work we can fix it if you share reproduction steps

MarkLFT commented 1 year ago

Thanks for the prompt response, I originally tried it in a frame, then in a plain VerticalStackLayout, and in both cases the command did not fire. But keep it as a direct child of the FormView and it fires.

Many thanks, this project is a great help for me. I am making my first app, and enjoying it.

enisn commented 1 year ago

Ok, I'll investigate. It should be working, and currently it seems it's a bug. By the way, you can set your frame as submit button as a workaround until the bug is solved:

<Frame input:FormView.IsSubmitButton="True">
    <Button Text="Save" InputTransparent="True"/>
</Frame>

InputTransparent might be required for iOS & OSX

MarkLFT commented 1 year ago

Many thanks for the prompt action.

MarkLFT commented 1 year ago

Just to provide a little more feedback... The validations do not work also when in a frame.

'''

'''

This code does not raise any warnings and goes directly to the Submit command, removing the frame and warnings are displayed as expected.