-
Couldn't load subscription status.
- Fork 298
Description
I have worked up a small change to the textbox so that one could indicate a filter method that will be called on insert allowing to have some control over what gets put into a textbox.
The changes can be seen here: https://github.com/TheNeikos/conrod/tree/add-filter_to_textbox
However I have not put this as a PR yet because of two things:
- Is something like this wanted? In my current project I would definitely find several uses, but if 2 is not resolved it might not be worth it.
- This is a breaking change to the TextBox as for now it requires static dispatch (I implemented it like the react callback), it also means if you do not want to filter you will have to write at least:
.filter(|_string: &mut String, _ch: char|{true})This does not differ from the react callback, but for those that do not want to filter their input it adds more boilerplate. (Which also exists for the react callback, but I believe that react is a lot more used than a potential filter)
Could I have some input on whether to drop/continue working on it and whether it should be dynamic dispatch.