Here I am again with a little question. :sweat_smi...
# kobweb
c
Here I am again with a little question. ๐Ÿ˜… Are we able to use the Silk Button in a regular Dom Form? ๐Ÿค” I was following Stevdza-san's tutorial and noticed I used a different import for the button in a form. Since the Silk button has a
onClick
high order function that must be overridden I was not sure what to add in the function itself, and thus the form never actually completes xD I couldn't find anything related in the docs regarding the forms, so asking here was my next big guess.
๐Ÿ‘ 1
d
Make sure you're importing the right button
Right now Button and Input have Compose HTML and Silk variants
(You always want to choose the Silk one if it's available IMHO ๐Ÿ˜‰ )
Oh wait
I am going to leave my previous answer here as an embarassing testament to my not understanding and replying too soon (I tend to do that, my apologies)
Actually there is an issue where right now buttons prevent forms from working
In our next release, you should be able to do
Copy code
Button(
  onClick = { ... }
  type = ButtonType.Submit,
)
and it should work.
(Technical detail: I was using
evt.preventDefault
for some long forgotten legacy reason that wasn't necessary anymore. We removed it just a few days ago, and I say "we" but I really mean the other guy because he's the one on the ball ๐Ÿ˜„ )
BTW, if you're willing to live on the bleeding edge, you can set your version to 0.13.12-SNAPSHOT. The snapshot should have the fix for buttons (not confirmed, but I believe so) and 2) it will allow you to configure the switch thumb color, in case that was something you wanted to do as well.
c
Hahah, not a problem I do have that sometimes too xD And I noticed that I was using both imports for different parts of my project, thus creating a mixmatch of components that where not adjusting accordingly, so I'm going over every layout to update them to Silk (if possible) I already was using the Submit type for the Silk button, but because it wasn't working I assumed I was missing some other piece. Now with the snapshot version it works out of the bag so I continue using this awesome library ๐Ÿ˜„ Thank you for your helping me!
๐ŸŽ‰ 1