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

Support validation on all types of fields #200

Open
lfeigen opened this issue Aug 28, 2023 · 1 comment
Open

Support validation on all types of fields #200

lfeigen opened this issue Aug 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@lfeigen
Copy link

lfeigen commented Aug 28, 2023

Is your feature request related to a problem? Please describe.
We have one setting that is a proxy address. This is a "text" field in electron-preferences. However, this allows the user to set values that are not valid proxy addresses.

Describe the solution you'd like
Just as "list" items have validation support, so should all fields.

Describe alternatives you've considered
We've worked around this for now by not using the "save" functionality of electron-preferences and, instead, providing a "Save" button of our own. If they click this button with a bad value set for one of the fields, we pop up a dialog explaining the issue. It is not bad, but not as smooth as it could be.

@lfeigen lfeigen added the enhancement New feature or request label Aug 28, 2023
@pvrobays
Copy link
Collaborator

pvrobays commented Sep 6, 2023

Hi @lfeigen

Adding validation support is an option, where you can pass your own validation handler function with the config.

However, this one seems better to solve with a mask input field. I'm not sure if HTML input element by default has a mask property, but I'm sure there are libraries available that do this.

If I have some free time, I'll try to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants