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

Validate func on textinput doesn't restrict input #691

Open
daenmdir opened this issue Dec 20, 2024 · 0 comments
Open

Validate func on textinput doesn't restrict input #691

daenmdir opened this issue Dec 20, 2024 · 0 comments

Comments

@daenmdir
Copy link

          Hi! So actually `textinput` contains a [`Validate`](https://pkg.go.dev/github.com/charmbracelet/bubbles@v0.18.0/textinput#Model) property which can be used to restrict input to numbers only. The [credit card example](https://github.com/charmbracelet/bubbletea/tree/master/examples/credit-card-form) illustrates how to do this.

Originally posted by @meowgorithm in #481 (comment)

This does not seem to be working as of v0.20.0. And I don't see a KeyMsg.Type for keyboard numbers to intercept the messages with non-numerical inputs.

Is there a way to easily circumvent 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

1 participant