liferay/alloy-ui

Form doesn't validate and submit on a required hidden input

Closed this issue · 2 comments

If the form contains a required hidden input field than the form is submitted and a JS error happens:

aui-form-validator.js:694 Uncaught TypeError: Cannot read property 'selectText' of null
at component.focusInvalidField (aui-form-validator.js:694)
at DO.Method.exec (event-custom-base.js:290)
at component.obj. [as focusInvalidField] (event-custom-base.js:152)
at component.validate (aui-form-validator.js:1039)
at component._onFormSubmit (aui-form-validator.js:1358)
at Y_Node. (oop.js:403)
at Y.Subscriber._notify (event-custom-base.js:1306)
at Y.Subscriber.notify (event-custom-base.js:1335)
at Y.CustomEvent._notify (event-custom-base.js:998)
at Y.CustomEvent._procSubs (event-custom-base.js:1124)

Expected behaviour: Submission to stop, required validation to fire.

The AUI ticket: https://issues.liferay.com/browse/AUI-3194
The LPS ticket: https://issues.liferay.com/browse/LPS-119199
My suggested solution: https://issues.liferay.com/browse/LPS-119199?focusedCommentId=2225773&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2225773

Closing as this issue is resolved with jonmak08#457