-
Notifications
You must be signed in to change notification settings - Fork 273
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
Input: required
attribute has no effect
#3498
Labels
Comments
Hi @SAP/ui5-webcomponents-topic-rl , This issue is well described - ui5-input with attribute required does not work with Kind regards, |
This is related to the form support feature. I'll have a look. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
The
required
attribute has no effect when used in a form.Expected Behavior
When
required
is set inside a form, it should not be possible to submit the form if the input field has no value, also it should be possible to validate if the form is valid withcheckValidity()
.Steps to Reproduce
required
attribute and because of that, thecheckValidity()
method is returningfalse
.checkValidity()
method is returningtrue
, even though the "UI5-Input" isrequired
and has no value.Isolated Example
https://codesandbox.io/s/ui5-webcomponents-forked-6gwbj?file=/index.html
Context
Possible root cause
The

required
attribute is missing from the hidden input field, generated for form support.This is probably because of these lines:
ui5-webcomponents/packages/main/src/features/InputElementsFormSupport.js
Lines 80 to 83 in 97a8713
Here, only
disabled
andvalue
are copied to the hidden input element.The text was updated successfully, but these errors were encountered: