Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateFocusClassName() {
const { refs, props } = this;
// avoid setState and its side effect
if (this._focused) {
classes(refs.root).add(`${props.prefixCls}-focused`);
} else {
classes(refs.root).remove(`${props.prefixCls}-focused`);
}
},
updateFocusClassName = () => {
const { rootRef, props } = this;
// avoid setState and its side effect
if (this._focused) {
classes(rootRef).add(`${props.prefixCls}-focused`);
} else {
classes(rootRef).remove(`${props.prefixCls}-focused`);
}
};
updateFocusClassName = () => {
const { rootRef, props } = this;
// avoid setState and its side effect
if (this._focused) {
classes(rootRef).add(`${props.prefixCls}-focused`);
} else {
classes(rootRef).remove(`${props.prefixCls}-focused`);
}
};
it('should be added', (done) => {
let radio1 = el.getElementsByTagName('input')[0]
let radio2 = el.getElementsByTagName('input')[1]
let radio3 = el.getElementsByTagName('input')[2]
let radio4 = el.getElementsByTagName('input')[3]
let cls1 = classes(radio1)
let cls2 = classes(radio2)
let cls3 = classes(radio3)
let cls4 = classes(radio4)
let group1 = [cls1, cls2]
let group2 = [cls3, cls4]
each(group1, (cls, index) => {
assert(cls.has('valid'))
assert(!cls.has('invalid'))
assert(!cls.has('touched'))
assert(cls.has('untouched'))
assert(cls.has('pristine'))
assert(!cls.has('dirty'))
assert(!cls.has('modified'))
})
each(group2, (cls, index) => {
each(['0', '4'], (val) => {
const cls = classes(el.getElementsByTagName('input')[parseInt(val)])
assert(!cls.has('valid'))
assert(cls.has('invalid'))
assert(cls.has('touched'))
assert(!cls.has('untouched'))
assert(cls.has('dirty'))
assert(cls.has('modified'))
})
done()
this.updateFocusClassName = function () {
var refs = _this2.refs,
props = _this2.props;
if (_this2._focused) {
classes(refs.root).add(props.prefixCls + '-focused');
} else {
classes(refs.root).remove(props.prefixCls + '-focused');
}
};
this.updateFocusClassName = function () {
var refs = _this2.refs,
props = _this2.props;
if (_this2._focused) {
classes(refs.root).add(props.prefixCls + '-focused');
} else {
classes(refs.root).remove(props.prefixCls + '-focused');
}
};