skratchdot / react-bootstrap-multiselect

A multiselect component for react (with bootstrap). This is a react port of bootstrap-multiselect.
http://projects.skratchdot.com/react-bootstrap-multiselect/
Other
119 stars 62 forks source link

Getting error elem.cloneNode is not a function #30

Open RahulDole opened 8 years ago

RahulDole commented 8 years ago

Firstly, thanks a lot for writing this React wrapper around bootstrap multiselect. It works like a charm! However, I got error initially and it was not rendering at all due to a line in your index.js code: $this.$multiselect = $($this.refs.multiselect);

I was getting an error from jquery saying that elem.cloneNode is not a function, because it wasn't able to access the actual DOM of the select tag. So I modified that line in my project to this: $this.$multiselect = $(React.findDOMNode($this.refs.multiselect));

Then it worked perfectly.

skratchdot commented 8 years ago

Thanks for the feedback. I believe the code once used findDOMNode(), but then removed it when React 0.14 came out. I guess it should be added back in. Thanks again!

tBaxter commented 8 years ago

Wouldn't it be better to remove the jquery dependency there altogether? It's 2016, we can find dom nodes without jquery.