-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only calls one 'onSubmitCustomKeyboard' #2
Comments
Hey! Thanks for your kind words! And your very detailed lookinto it already! Im pretty confident it has to do with the fact that we define one static keyboard in my example. And every assignment of the "onSubmit" closure reassigns it and therefore you lose the previous closure. I think to fix this I have to redesign this API so that every textfield can have its own keyboard instance with its own onSubmit closure. Will get to work as soon as possible! :) |
Hey @SPMen, I will merge upon your approval if its fixed for you :) Kind regards |
Hello Pascal, Wow...yes, this works great!!! I tried the changes on the test code I posted and on my own project. It worked perfectly for both. Thank you for sharing CustomKeyboardKit...it really is so helpful, so simple, and a gift to those of us who use it (and aren't quite as impressive in programming as you are). You are kind to share! Take care, |
Omg thank you for your kind words! But Kudos to you! Your first analysis and great systematic feedback helped me to nail down the issue efficiently! I will merge it to master directly so that you'll have the changes when you directly fetch the Swift Package next time :-) Have a great weekend! |
@paescebu anywhere I can buy you a coffee or show some support? |
This is such a help....thank you so much for posting it. You're absolutely right to say it is the easiest way to add a custom keyboard to SwiftUI.
I've been having one issue: only one
onSubmitCustomKeyboard
is called, even if I have multiple instances with a few different text fields. I thought at first it might be something in my code, so here's what I did to check: I started a new project in Xcode, installed the package, and copied the code of your sampleyesnt
keyboard. Then I only slightly modified your sample implementation:When run, only the first
onSubmitCustomKeyboard
is ever called ("Textfield #1 submit"), even whensubmit?()
is called in Textfield #2 or Textfield #3.Is that how it is supposed to work? In my own actual project, for some reason it is oddly calling the third instance of
onSubmitCustomKeyboard
every time, and I can't make sense of why.The text was updated successfully, but these errors were encountered: