Open shiyeling opened 2 years ago
This is called input masking: https://css-tricks.com/input-masking/
This is called input masking: https://css-tricks.com/input-masking/
Thanks for letting me know. That looks intuitive and nice.
Is there any news about this issue? I'm also interested by IPV4(auto-adding dots each three characters) and port input fields, but I don't understand how to implement @lacymorrow suggestion in a non-jquery way:
This is called input masking: https://css-tricks.com/input-masking/
@dewiweb Did you open the link? The first example is jQuery.
If you have specific questions about issues you are having and want to post a code sample, I'm happy to assist.
Finally I use regex to validate ipv4:port and open a info message box if user entries are unvalidated by regex. @lacymorrow Thanks for reply but I don't use jQuery !
@dewiweb Good that you found a workaround. I think what @lacymorrow proposed is just a few ways of how we could implement input masking in electron-preferences. However, it currently isn't.
If you want you can try to implement it and create a PR :)
@pvrobays I don't think the library is completely set up for this, but I think we could do something fancy with the regular text input field to allow the user to manage the input/mask themselves.
Potentially allow them to receive change events and pass an optional value to the input.
Is your feature request related to a problem? Please describe. In my case, i need to configure a server address, might be an IP address or domain name. Now I'm using just text input, it could work but user does not have proper feedback if they messed up the address format.
Describe the solution you'd like provide validation and prompt for IP address or domain name input, which programmer could provide as an validation function in preference constructor.
Describe alternatives you've considered A call back function so that programmer could valide preference and prevent user from saving mal-formatted preference data.
Additional context NONE