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 email and url form input types #4186

Merged
merged 4 commits into from
Nov 18, 2019

Conversation

scop
Copy link
Member

@scop scop commented Nov 4, 2019

Since home-assistant-libs/voluptuous-serialize#8, voluptuous-serialize can include format info for strings: url, email, and fqdnurl. Would be useful to support these in HA forms. I would probably have used the url one in Huawei LTE's config UI had it been possible.

This change is completely untested, I have no idea if it works, and I'm really fairly clueless wrt this stuff, but maybe it helps someone to beat it into shape unless it by some scary luck actually works as is :)

In case it doesn't, feel free to take and finalize it, I'm not sure if I have time to get to know this stuff, I rather work on something non-UI in HA.

@bramkragten
Copy link
Member

You are aware that this won't change much? It will only show a different keyboard on some mobile devices.

@scop
Copy link
Member Author

scop commented Nov 18, 2019

In addition to changing the keyboard on some mobile devices (which I consider valuable already), I'd assume that it also makes browsers natively validate the fields' contents. At least that's what happens with regular HTML input fields, dunno about the HA UI ones.

@bramkragten
Copy link
Member

In addition to changing the keyboard on some mobile devices (which I consider valuable already), I'd assume that it also makes browsers natively validate the fields' contents. At least that's what happens with regular HTML input fields, dunno about the HA UI ones.

Yes it does, and that is indeed very valuable. We might need to adjust the error messages, as it only used to check it is was required -> empty.

image

@bramkragten bramkragten merged commit 1e217e8 into home-assistant:dev Nov 18, 2019
@scop scop deleted the form-string-types branch November 18, 2019 21:07
@bramkragten bramkragten mentioned this pull request Nov 19, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants