Semantic-ui: [Form Validation] Error when calling "validate form" with API attached

Created on 14 Jul 2017  路  6Comments  路  Source: Semantic-Org/Semantic-UI

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) {

Evaluating Bug / Change Needs Test Case stale

All 6 comments

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

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).

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.

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!

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

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miguelmota picture miguelmota  路  3Comments

batata004 picture batata004  路  3Comments

mllamazares picture mllamazares  路  3Comments

Morrolan picture Morrolan  路  3Comments

arj-196 picture arj-196  路  3Comments