reactjs - 是的,移动浏览器中的验证失败 React js
问题描述
以下代码仅在移动浏览器中给出验证错误 Q1..Q5 是下拉值。第一次选择后出现验证消息,如果从同一个下拉列表中选择另一个选项,验证错误就会消失。
initialValues : {
Q1 : '',
Q2 : '',
Q3 : '',
Q4: '',
Q5 : ''
}
validationSchema: yup.object().shape({
Q1 : yup.object().required('All answers are mandatory'),
Q2 : yup.object().required('All answers are mandatory'),
Q3 : yup.object().required('All answers are mandatory'),
Q4 : yup.object().required('All answers are mandatory'),
Q5 : yup.object().required('All answers are mandatory'),
});
Q1..Q5 will have the value of the form
{ label : 'X' value : 'x' }
第一次选择后
解决方案
推荐阅读
- android - 使用多键 Firebase 实时数据库检索数据
- nedb - 使用非正则表达式调用 NeDB 正则表达式运算符
- python - sqlite3:用python创建函数正则表达式
- android - 通过 rxJava 2 获取远程数据或获取本地数据
- javascript - 是否可以将 js 函数传递给事件处理程序构造函数?
- c# - 为什么在使用信号量时这 4 个线程会被锁定?
- html - 如何获得“275,47”值(BeautifulSoup,Python3)
- sql - oracle ratio_to_report
- apache - 条件 URL 重写
- python - 拆分列表中的元素和单独的字符串,然后计算长度