Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

required sample custom element in the demo is not actually required #58

Closed
jab opened this issue Oct 3, 2015 · 2 comments
Closed

required sample custom element in the demo is not actually required #58

jab opened this issue Oct 3, 2015 · 2 comments

Comments

@jab
Copy link
Contributor

jab commented Oct 3, 2015

Reproduction steps:

  1. Go to the demo
  2. Fill in the required Name and Favourite animal fields and check the two (unchecked) required checkboxes
  3. Click SUBMIT

Expected behavior: The form does not submit because the required custom element is empty, and the required custom element gets its "invalid" styling

Actual behavior: The form submits, the required custom element does not get its "invalid" styling.

screen shot 2015-10-03 at 15 15 21

Please let me know if I'm missing something, as I've been hoping to make progress on #56 and GoogleWebComponents/google-recaptcha#11, and if this is broken in iron-form I better wait for the fix first. Thanks in advance for taking a look.

jab added a commit to jab/iron-form that referenced this issue Oct 4, 2015
When submitting the form without filling in anything in the custom element,
the value of this.value for the custom element would be undefined.
Consequently, the old logic of _getValidity() returning this.value != ''
would return true. Changing this to the less strict check !!this.value
allows it to still be considered invalid when this.value is undefined.

Closes PolymerElements#58.
@jab
Copy link
Contributor Author

jab commented Oct 4, 2015

@notwaldorf just submitted a PR with a fix! :)
#59

@jab
Copy link
Contributor Author

jab commented Oct 4, 2015

(turned out to just be a small logic tweak in the demo, nothing wrong with iron-form's custom validity logic at all)

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

No branches or pull requests

1 participant