Opened 11 years ago
Closed 9 years ago
#10987 closed Bug (fixed)
[Blink] Copy-paste table within CKE breaks width percentage.
Reported by: | Joel | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Blink Chrome | Cc: | Stephen.Eidson@… |
Description
For my content widths being percentages is very important. When you copy a table with a width like 100% and the paste the same table in CKE, the width is replaced with a pixel value, which breaks layouts.
- Go to ckeditor.com/demo in Chrome (Opera not tested)
- Clear editor and add a table with a 100% width
- Click the table in elementspath to select it
- Move cursor to new paragraph
- Hit Ctrl-v or click paste from word to paste the table
- Check the table width, it is no longer fluid but horrid static pixels
Works fine in IE9
Change History (5)
comment:1 Changed 11 years ago by
Keywords: | Blink Chrome added |
---|---|
Status: | new → confirmed |
comment:2 Changed 11 years ago by
comment:3 Changed 11 years ago by
I created a (stupid) workaround for this. It only works for my situation because I know that the majority of tables in my content is 100% and I never want to see anything defined as pixels anywhere. This might be useful to someone somewhere, so here.
if(window.chrome) { editor.on('paste', function(even) { var str = even.data.dataValue; if(str.indexOf("<table") != -1) { var regex = /width:\d+px;/g; str = str.replace(regex, "width:100%;"); even.data.dataValue = str; } }); }
comment:4 Changed 9 years ago by
Cc: | Stephen.Eidson@… added |
---|
This appears to have been fixed!
I was seeing this issue with CKEditor 4.4.7 using Chrome 43.0.2357.130 (64-bit) on osx. I noticed, however, when looking at http://ckeditor.com/demo, that the issue no longer happens.
After upgrading to the newest version of CKEditor Full 4.5.1, I'm no longer experiencing the issue.
comment:5 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
Yes, CKEditor 4.5.0 introduced custom integration with the clipboard. CKEditor now doesn't let the browser copy the content - it is handled by the editor. There was also a change in the paste process. The editor uses now the Clipboard APIs (whenever possible - IEs don't support it) to access content directly from the clipboard. Previously, the pastebin was used. This, allowed us to bypass all the terrible Chrome and Webkit problems with copying content.
Read more in http://docs.ckeditor.com/#!/guide/dev_clipboard
This is a Chrome's bug. We have no control over what's copied into clipboard. You can file bug here: https://code.google.com/p/chromium/issues/list
On our side I can only imagine that storing width in some data-* attribute could help. So as there's a way to workaround this issue, I confirm this ticket.