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

Add empty option value to styledSelectFormField for required html validation #1996

Merged

Conversation

andreytroeglazov
Copy link
Contributor

No description provided.

@amitaibu
Copy link
Collaborator

amitaibu commented Aug 6, 2024

@andreytroeglazov Thanks. Errors seem unrelated. Can you please check if removing those imports fixes the issue

image

@mpscholten
Copy link
Member

Shouldn't we make this conditionally based on whether required is set? E.g. if required == True we want the existing behaviour, and when required == False we want to set value=""?

@andreytroeglazov
Copy link
Contributor Author

If required == True we need value="" on placeholder so the html validation will work correctly.
If required == False it does not matter if we have value="" or not. But to keep things consistent I think it's better to always have value="" on placeholder option.

@mpscholten
Copy link
Member

Thanks, got it now 👍

@mpscholten mpscholten merged commit 2ad0ea6 into digitallyinduced:master Aug 7, 2024
1 of 2 checks passed
@mpscholten
Copy link
Member

@andreytroeglazov the tests need to be updated as well https://github.com/digitallyinduced/ihp/actions/runs/10289623933/job/28477778824 can you take a look?

@andreytroeglazov
Copy link
Contributor Author

@mpscholten sure, will check

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

Successfully merging this pull request may close these issues.

3 participants