skip js validation for readonly/disabled fields#1306
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1306 +/- ##
============================================
+ Coverage 29.05% 29.22% +0.17%
- Complexity 7217 7233 +16
============================================
Files 104 105 +1
Lines 23808 23853 +45
============================================
+ Hits 6917 6972 +55
+ Misses 16891 16881 -10 ☔ View full report in Codecov by Sentry. |
I'm not sure about this, it makes sense to me to trigger the error as long it is set up as required + readonly. @Crabcyborg what do you think? |
|
Thanks @Liviu-p and @garretlaxton. This seems like a weird conflict of settings the more I think about this. I don't understand how something would make sense as read only, and also required, with no default value. It seems like something that should display a warning in the form builder. @stephywells What do you think makes sense here? Should we really validate anything disabled with JS? When it's disabled, no value gets sent anyway so I don't know why we'd validate it before its sent. |
|
@Crabcyborg it seems like a validation message isn't helpful if the user can't do anything about it. But we also don't want to allow people to manually clear out the read only value and then get past validation. This does seem to me like more of an error on the builder end that we should notify of the issue. Is it possible to handle this type of error with a message on the builder page like you mentioned? |
|
Thanks @stephywells! We'll look into adding a warning. |
|
@Liviu-p Could you try to work on that when you have the chance? |
sure @Crabcyborg, I will take care of it. |
|
I'm going to close this PR for now. I think we can leave the validation as-is for now. I fixed this issue in another way (See #1946), by addressing the JS error instead. |


Fixes https://github.com/Strategy11/formidable-pro/issues/4447