react-sortablejs: Uncaught Sortable: `el` must be HTMLElement, and not [object Object]
Example source code gives following exception:
Uncaught Sortable: `el` must be HTMLElement, and not [object Object]
Nothing gets rendered.
Libraries versions used:
- Sortable 1.4.2
- react-sortablejs v1.0.0
- React.version “15.0.2”
- ReactDOM.version “15.0.2”
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19
You probably call sortable before DOM has been ready. This is why element is null.
in my case this error occurred because I’m instantiating SortableJS in a common footer and hence the error appears on those pages where the sortable element is missing. Fix? I wrapped it in a
In my case this error raised because same id ‘bar’ assigned to multiple elements.
Like
<ul
id=‘bar’ name=‘bar’<select
id=‘bar’ name=‘bar’After removing reuse of ‘bar’ as id of select everything working normal.
In my case, I was being special and importing
Sortable from 'sortablejs'
instead of importing fromreact-sortablejs
One of those silly but easily overlookable mistakes 🙄
Hi,
I am facing the same issue, using plugin version 1.6.1. Here is below my code:
Thanks in advance for your help!
Regards, Abdullah @wpplugindev