Skip to content

Conversation

jameschenjav
Copy link

Closed Issues

#5745

Description

remove rule(field, rules) should remove all rules when argument rules is omitted. But field may not have any rules, and it would raise exceptions because of validation[field].rules = [].

There is some guard code to check if validation[field].rules exists, but the order is wrong apparently.

Testcase

https://jsfiddle.net/whd3o60j/3/

Click "Remove All Validations", raised exception Uncaught TypeError: Cannot set property 'rules' of undefined (in Chrome)

visit `rules` on undefined `validation[field]`
@lubber-de

This comment was marked as spam.

@jameschenjav
Copy link
Author

hi @lubber-de
i noticed semantic-ui repo stopped updating after i created this PR and mentioned it to our dev team.
i suggested to our team after saw your comment, and today we've decided to adopt fomantic-ui for further upgrades.
thanks for the great work.

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

Successfully merging this pull request may close these issues.

2 participants