clauderic / clauderic/react-sortable-hoc

IE11, d&d starting from an SVG element (like path) fails + toLowerCase call on undefined error

Open
#342 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

On IE11, for unknown reasons, it seems we are unable to get the tagname:

```javascript
shouldCancelStart: function(e) {
// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
const disabledElements = ['input', 'textarea', 'select', 'option', 'button'];

if (disabledElements.indexOf(e.target.tagName.toLowerCase()) !== -1) {
return true; // Return true to cancel sorting
}
},
```

shouldCancelStart calls toLowerCase on null/undefined on IE11

https://github.com/clauderic/react-sortable-hoc/blob/e599da7fefa5550f9a1d65cad302e5c77ea6ac7b/src/SortableContainer/index.js#L51

We got in production this error: `#40 TypeError: Impossible d’obtenir la propriété « toLowerCase » d’une référence null ou non définie` which means tagName is null or undefined

Not sure exactly when it happens, but it does.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.