Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

[Form Validation] Error when calling "validate form" with API attached

Open dwightbcoder opened this issue 9 years ago • 6 comments

If a form is manually validated with "validate form" an error is thrown for the call to event.stopImmediatePropagation() if there is an API attached to the form.

The fix is a simple change on form.js:942

if($module.data('moduleApi') !== undefined) {

to:

if(event && $module.data('moduleApi') !== undefined) {

dwightbcoder avatar Jul 13 '17 22:07 dwightbcoder

Hi, could you please provide a test case as per our contributing guidelines? You can fork this JSFiddle.

awgv avatar Jul 14 '17 06:07 awgv

If you look at the code for form.js you'll see that "event" is used without verifying that it is set, never a good idea unless it should be fatal (not this case).

dwightbcoder avatar Aug 09 '17 14:08 dwightbcoder

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 23 '18 08:02 stale[bot]

We had this exact issue, applied the fix that @dwightbcoder mentioned and it worked. It would be great to see this merged in as a Pull Request. Thanks!

xaeroseven avatar Jun 19 '18 21:06 xaeroseven

Thanks @dwightbcoder . We adopted your fix in Fomantic-UI by https://github.com/fomantic/Fomantic-UI/pull/709

lubber-de avatar Apr 30 '19 09:04 lubber-de

Thanks @dwightbcoder . We adopted your fix in Fomantic-UI by fomantic/Fomantic-UI#709

With the number of time SUI's maintainers have refused to even acknowledge this problem, I think you just convinced me to final port over to Fomantic. Thanks!

pbarney avatar Apr 11 '20 17:04 pbarney