Minor tweaks

This commit is contained in:
Josh Johnson 2016-09-15 21:34:10 +01:00
parent a2be7f276a
commit ef1e7d23ef

View file

@ -163,8 +163,8 @@ export default class Choices {
if (!cuttingTheMustard) console.error('Choices: Your browser doesn\'t support Choices');
// Input type check
const canInit = this.passedElement && isElement(this.passedElement) && ['select-one', 'select-multiple', 'text'].some(type => type === this.passedElement
.type);
const isValidType = ['select-one', 'select-multiple', 'text'].some(type => type === this.passedElement.type);
const canInit = isElement(this.passedElement) && isValidType;
if (canInit) {
// If element has already been initalised with Choices