Skip to content
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

Can't figure out how to show error in dedicated field in credit-card-example #654

Closed
gattiroberto1985 opened this issue Feb 8, 2023 · 2 comments

Comments

@gattiroberto1985
Copy link

Hello,

i see that in the credit-card-form example here that an error is stored in the model and an errMsg message is handled in the Update function. But i cannot make the error visible in the UI, nothing appears if i input a wrong character, neither if i print the error explicitly in the View function (if the error is not nil). It seems that the errMsg is never activated.

I can't find any documentation or example about this, is there something wrong in the example?
Thanks in advance!

@hopefulTex
Copy link

The validation functions are called by the text models whenever one receives the Update(teaMsg) call, all you have to do is pass it a message and the rest is taken care of. As for the errMsg , that's going to have whatever errors are passed into your program model itself, while the text inputs do error handling in their own Update() methods.
The errors are stored in the individual textinputs, m.inputs[n].Err , and they're set to nil if there's no error.

@bashbunni
Copy link
Member

Hey @hopefulTex,

This is an issue that's being discussed upstream in Bubbles. It would make more sense to continue the discussions and apply improvements over there. Thank you for bringing this to our attention! We haven't forgotten about this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants