enisn / Xamarin.Forms.InputKit

CheckBox, Radio Button, Labeled Slider, Dropdowns etc.
MIT License
579 stars 98 forks source link

ImageButton - FormView.IsSubmitButton not working #332

Closed YBTopaz8 closed 1 year ago

YBTopaz8 commented 1 year ago

Describe the bug FormView.IsSubmitButton doesn't seem to work on ImageButton . ON .NET MAUI There seems to be an issue with ImageButton control inside a FormView where doesn't seem to work. But it works just fine with a Button control. I even tried with 2 Buttons in the same FormView and they BOTH work as SubmitButton. But again, ImageButton doesn't seem to work as such.

To Reproduce Steps to reproduce the behavior:

  1. Create a simple FormView
  2. Add a simple TextField
  3. Add a simple RequiredValidation on the textfield
  4. Add an ImageButton and a Button control.
  5. Set FormView.IsSubmitButton="True" on both controls
  6. Run the app
  7. Click on Button and observe the validation working (shows an error message)
  8. Clear Textfield and click on ImageButton, Nothing happens

Expected behavior Upon clicking ImageButton Control, the FormView should perform a validation check, similar to the way Button control does.

Video

https://user-images.githubusercontent.com/41630728/211306971-d22a3c89-8234-42a8-a040-0e1315e6c919.mp4

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here. A screenshot of my code: image

enisn commented 1 year ago

It's released in 4.2.2. You can upgrade InputKit in your app until UraniumUI is updated. If it's not installed, you can add reference in your app's .csproj file until UraniumUI releases a new version with the latest Inputkit version

YBTopaz8 commented 1 year ago

Understood, thanks a lot!. I updated immediately after seeing your comment, but after that, my Project couldn't build anymore, due to an error with validation as you may see here: image

I thought maybe you had updated the docs on how to add validations, but apparently not . I even cleaned the project and rebuilt but still, no avail.

I decided to rollback to v4.2.1 just to see, and it still works well. image

Perhaps I am doing something wrong? If so, then I'd appreciate your guidance !

enisn commented 1 year ago

It shouldn't be conflicted.

UraniumUI is just released with the new version, you can remove inputkit dependency and update only uraniumui packages at the moment

YBTopaz8 commented 1 year ago

Oh dear sir, I apologize for raising so many issues, but I have some findings; After I updated from UraniumUI 2.2.1 -> 2.2.2 , I COULD not update InputKit from 4.2.1 -> 4.2.2. ( I even tried cleaning build) So, I DELETED InputKit completely from my project and then updated from UraniumUI 2.2.1 -> 2.2.2. (and cleaned build) The Issue was : The FormView does not perform any validations AND does not perform the SubmitCommand. I tried with a simple, sample code just to test here: image

When I clicked on the button, nothing happens, no validation check, no running of RelayCommand, same for when I click on ImageButton.

So, I TRIED Reinstalling InputKit v4.2.2 from Nuget, cleaned build and rebuilt. That is when I noticed sometime interesting:

  1. FormView.IsSubmitButton and SubmitCommand now work on ImageButton. In fact it even works with a simple Label
  2. FormView.IsSubmitButton does NOT work with Button any more. Here is a short video of the code from my project and a demo in the android emulator:

https://user-images.githubusercontent.com/41630728/211425220-06b6a045-8249-40be-9ada-373c08428599.mp4