Open Sn3llius opened 1 month ago
While I like the proposal in general, I'd argue for an alternate way of specifying what constitutes valid content - regex. This would allow for much more flexibility in what users can (and cannot!) enter.
This comes with challenges however, which is also the reason it doesn't exist yet:
1
would be valid. 1.
wouldn't. But 1.0
would be. The regex would thus have to allow for these nonsensical intermediate values.This needs discussion.
Description
Enhance the
rio.TextInput
component by adding support for two new features:max_length
andvalid_inputs
. These features will provide greater control over the input data by restricting the length of the text and the valid characters or patterns users can input.Suggested Solution
max_length should be pretty self explanatory. Should work analogue to . Default should be None
valid_inputs should take a string or Iterable[str], preventing other symbols for being put in. default should be string.printable
Alternatives
No response
Additional Context
No response
Related Issues/Pull Requests
No response