-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contentEditable attribute doesn't work in gridstack #939
Comments
I noticed that right-click also works, but opens of course the context-menu. |
I have not tried it, but you might need to separate the area you drag (I typically use a 20pix header in my widgets) vs the content area that I let use interact with content (graphs in my case). I'm guessing jquery-ui drag event is conflicting with editing events if on the same div... |
So I've been playing around with this a bit. I've got some HTML that looks like this:
The contents of the inner-most div will get filled in via ajax, but it contains something like:
This is debugging code, so it's not expected to be pretty.... or even correct! Now, at this point, I can click on the email span, and the cursor gets positioned at the beginning of the span content. But, I can cursor over and make changes, and those changes get passed on to javascript. However, if I change the div class from grid-stack-item to Xgrid-stack-item, I end up being able to click on the email address and having the cursor positioned where I expect it. This is the the ONLY change I've had to make to get the expected behavior. So, grid-stack seems to be using javascript to modify DOM elements in the grid-stack-item class. For the record, my event handlers aren't very fancy: function start_edit(id, name) { o = document.getElementById(name); } function end_edit (id, name) { I hope this helps, because I love using this library. Mike. |
I think I fixed it somehow or found a way around. But was half a year ago, I need to have a look at my code when I find some spare time at work. |
this is fixed in 3.x with HTML5 D&D, on chrome. I changed float.html first widget to have {x: 1, y: 0, w: 4, content: '<div contentEditable="true">Titel</div>'}, and I can edit and move the widget by the text area just fine. |
You should re-open this bug for v7.1.0. Thx |
closed in upcoming 7.1.1 |
Just wanted to point out that
contentEditable="true"
in gridstack behaves weird.I only have tried it to use it in Two Grids Demo.
It doesn't work.
It works partially when settings
$(this).focus();
on aonclick
event;This makes the content editable. But it makes it only able to put yourr mouse pointer in front of the text Can't put the mouse curser in between characters, or selecting all text.
The text was updated successfully, but these errors were encountered: