Closed batisteo closed 1 year ago
I added some basic input validation functionality, including prebuilt phone number and email address validators. Are there any other validators that you think should be in by default?
Would it be possible to disallow the user to even enter characters for example?
So like we could set an Input to be numeric only, and pressing non-digits has no effect?
I haven't checked the source code to see if you handle it as a line of input or character by character, so this might not be possible.
No, that needs changes in the interaction logic for prompts. You can either write one yourself or if it's something common like a number, then contribute it to the library.
@batisteo I don't know when it was added, but there exists an input validation feature now. If you have some spare time, can you check if this is what you originally envisioned when you opened the issue?
I guess it would do it. I was thinking about including some common ones (int, str, email…) but I far as I can see it seems very flexible solution.
It would be nice to have something similar:
https://github.com/CITGuru/PyInquirer/#input---type-input