jasonslyvia / react-anything-sortable

A ReactJS component that can sort any children with touch support and IE8 compatibility
http://jasonslyvia.github.io/react-anything-sortable/demo/
MIT License
460 stars 84 forks source link

Problem with Contenteditable div #38

Open dineshvgp opened 8 years ago

dineshvgp commented 8 years ago

I'm in a situation where I need to render a contenteditable div.

So, just tried it by adding contenteditable div in demoItem.js. Then, whenever I click inside the div, cursor focuses at starting point of the text, not at the place where I clicked.

Please help me out.

jasonslyvia commented 8 years ago

Can you provide some snippet or working demo?

dineshvgp commented 8 years ago

Please clone this forked repo. Start the app and hit http://0.0.0.0:8722/#/handle

Now, in DemoItem.js, removing inline: true , which is in line 26 will work fine.

But I need to pass inline: true, as I need to fix the toolbar to the place I need.

jasonslyvia commented 8 years ago

After cloning your repo, I fail to figure out how tinymce.js works.

Can you confirm it works without react-anything-sortable? By adding three elements in the same page with indentical settings. If so, there might be some event collision( which I don't think probable because I've commented out event handlers in SortableItemMixin but the issue remains).

dineshvgp commented 8 years ago

So, I removed mixins: [SortableItemMixin], and this.renderWithSortable from DemoItem.js. It works as expected. Could you please check the same?

jasonslyvia commented 8 years ago

Yeah I'm sorry kinda busy these days, need to dive into tinymce to figure out why they don't work together.

hvergara commented 8 years ago

This is because old version was capturing onSelect event on non-IE browsers. Fixed in #57