Skip to content

Commit d53fb6c

Browse files
author
patricktr
committed
bug fix for converting htmlCollection to a js array
1 parent c181101 commit d53fb6c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.1 (2019-10-9)
2+
3+
Bug fix for correctly converting a HTML Collection to Javascript array (was broken for some browsers)
4+
15
# 1.2.0 (2019-10-9)
26

37
New prop `onDropSuccess` callback to obtain column information and indexes for the ondrop event (probably more info than you want to know!)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-table-hoc-draggable-columns",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "ReactTable HOC for draggable columns",
55
"author": "patricktran",
66
"license": "MIT",

src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ export default Component => {
6666
// end helper methods
6767

6868
createDragEvents() {
69-
const headers = DomHelper.findChildrenWithClassName(
69+
const headersCollection = DomHelper.findChildrenWithClassName(
7070
this.containerRef.current,
7171
`${this.uniqueId} draggable-header`
7272
)
7373

74+
// convert HTML collection to Javascript array
75+
const headers = [...headersCollection]
76+
7477
headers.forEach((header, i) => {
7578
// only allow drag events on drag enabled columns
7679
if (header.className.includes('enable-drag')) {

0 commit comments

Comments
 (0)