Permalink
Browse files

fix: 解决数字组件校验失效的问题

  • Loading branch information...
LiuYueKai committed Jun 6, 2017
1 parent dd5535e commit 1f6afdcbe19ff4b5bce354ca3f9a9d37b7cc4933
Showing with 6 additions and 10 deletions.
  1. +2 −6 src/keroa-float.js
  2. +2 −2 src/keroa-integer.js
  3. +2 −2 src/keroa-string.js
View
@@ -81,9 +81,7 @@ var FloatAdapter = u.BaseAdapter.extend({
on(this.element, 'blur', function() {
var newValue;
if (self.enable) {
if (!self.doValidate({
'trueValue': true
}) && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('')
@@ -120,9 +118,7 @@ var FloatAdapter = u.BaseAdapter.extend({
var self = this,
newValue;
if (self.enable) {
if (!self.doValidate({
'trueValue': true
}) && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('')
View
@@ -71,7 +71,7 @@ var IntegerAdapter = u.BaseAdapter.extend({
on(this.element, 'blur', function() {
if (self.enable) {
if (!self.doValidate() && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('')
@@ -106,7 +106,7 @@ var IntegerAdapter = u.BaseAdapter.extend({
var self = this
self.element.value = (self.element.value + '').replace(/\,/g, '');
if (self.enable) {
if (!self.doValidate() && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('');
View
@@ -41,7 +41,7 @@ var StringAdapter = u.BaseAdapter.extend({
on(this.element, 'blur', function(e) {
if (self.enable) {
if (!self.doValidate() && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('')
@@ -56,7 +56,7 @@ var StringAdapter = u.BaseAdapter.extend({
hide: function() {
var self = this;
if (self.enable) {
if (!self.doValidate() && self._needClean()) {
if (!self.doValidate().passed && self._needClean()) {
if (self.required && (self.element.value === null || self.element.value === undefined || self.element.value === '')) {
// 因必输项清空导致检验没通过的情况
self.setValue('')

0 comments on commit 1f6afdc

Please sign in to comment.