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

Cannot require a field with an alt-datetime widget #3847

Open
4 tasks done
samath117 opened this issue Aug 30, 2023 · 2 comments
Open
4 tasks done

Cannot require a field with an alt-datetime widget #3847

samath117 opened this issue Aug 30, 2023 · 2 comments

Comments

@samath117
Copy link

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Consider the form at this shared playground link.

A timestamp with the alt-datetime widget is placed in two layers of objects. It is required at the lower layer, but it is possible to submit the form without filling it in:

image

Expected Behavior

There are a couple similar / simpler cases that work correctly:

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

@samath117 samath117 added bug needs triage Initial label given, to be assigned correct labels and assigned labels Aug 30, 2023
@nickgros
Copy link
Contributor

nickgros commented Sep 1, 2023

@samath117 It's expected that if object_with_timestamp is not required, then you can submit it without filling out the field. The validation with the regular datetime widget is HTML5/browser validation, which is not controlled by RJSF other than globally enabling/disabling it, which is why you see different behavior.

@nickgros nickgros added awaiting response and removed bug needs triage Initial label given, to be assigned correct labels and assigned labels Sep 1, 2023
@samath117
Copy link
Author

Ah, apologies, I was missing another variant: With the default text widget, the behavior is the same as the datetime widget:
Object with String Variant

image

That is, there is no need to also require the intermediate layer in the normal text widget. The select and radio widgets (when the string has an enum) also have the same behavior. So the bug either lies with all other widgets or with the alt-datetime widget alone.

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

No branches or pull requests

2 participants