Skip to content

Commit

Permalink
convert nodelist to array
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Aug 1, 2017
1 parent 08692d6 commit 61ac187
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/field.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uniqId, assign, normalizeRules, setDataAttribute, toggleClass, getInputEventName, debounce, isCallable, warn } from './utils';
import { uniqId, assign, normalizeRules, setDataAttribute, toggleClass, getInputEventName, debounce, isCallable, warn, toArray } from './utils';
import Generator from './generator';

const DEFAULT_OPTIONS = {
Expand Down Expand Up @@ -387,8 +387,8 @@ export default class Field {
}

if (~['radio', 'checkbox'].indexOf(this.el.type)) {
let els = document.querySelectorAll(`input[name="${this.el.name}"]`);
els.forEach(el => {
const els = document.querySelectorAll(`input[name="${this.el.name}"]`);
toArray(els).forEach(el => {
el.addEventListener(e, validate);
this.watchers.push({
tag: 'input_native',
Expand Down

0 comments on commit 61ac187

Please sign in to comment.