diff --git a/src/dom_components/model/ComponentTableBody.js b/src/dom_components/model/ComponentTableBody.js index dfb77e658..f3cd41103 100644 --- a/src/dom_components/model/ComponentTableBody.js +++ b/src/dom_components/model/ComponentTableBody.js @@ -1,11 +1,14 @@ import Component from './Component'; +import { toLowerCase } from 'utils/mixins'; + +const type = 'tbody'; export default Component.extend( { defaults: { ...Component.prototype.defaults, - type: 'tbody', - tagName: 'tbody', + type, + tagName: type, draggable: ['table'], droppable: ['tr'], columns: 1, @@ -45,14 +48,6 @@ export default Component.extend( } }, { - isComponent(el) { - let result = ''; - - if (el.tagName == 'TBODY') { - result = { type: 'tbody' }; - } - - return result; - } + isComponent: el => toLowerCase(el.tagName) === type } ); diff --git a/test/specs/dom_components/model/ComponentTypes.js b/test/specs/dom_components/model/ComponentTypes.js index afc4532b7..74caea70f 100644 --- a/test/specs/dom_components/model/ComponentTypes.js +++ b/test/specs/dom_components/model/ComponentTypes.js @@ -44,6 +44,10 @@ describe('Component Types', () => { expectedType('