Ticket #2496 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years ago

InsertHtml() ignores current selection in IE. Again.

Reported by: jwhitcraft Owned by: alfonsoml
Priority: Normal Milestone: FCKeditor 2.6.4
Component: UI : Dialogs Version: FCKeditor 2.6.3
Keywords: IE Confirmed Review+ Cc:

Description

It seems that this bug #2125 has come back again in Version 2.6.3 as I have having troubles with it. You can test this on the demo page with IE. It will insert the text at the start of the box instead of where the cursor is at when you open up the paste dialog.

Attachments

2496.patch (1.2 KB) - added by alfonsoml 6 years ago.
Proposed patch
2496_1.patch (1.2 KB) - added by alfonsoml 6 years ago.
Revised patch

Change History

comment:1 Changed 6 years ago by alfonsoml

  • Keywords IE Confirmed added; ie dialog inserthtml removed

It doesn't seems exactly that the problem is InsertHtml, because the Paste as Plain Text does work properly, so it looks like something else is involved in the dialog itself.

comment:2 Changed 6 years ago by alfonsoml

I've found that the problem is the fix for #2426, in the paste or paste from word dialog, there's a contentEditable frame, so the new check is true for that situation and the selection isn't restored properly (you can verify also that setting the focus in one of the checkboxes in the Paste from word dialog makes it work properly.

Changed 6 years ago by alfonsoml

Proposed patch

comment:3 Changed 6 years ago by alfonsoml

  • Owner set to alfonsoml
  • Status changed from new to assigned
  • Keywords Review? added

This patch modifies the Ok function so it moves the focus out of the editing area in any dialog and that way the check added in #2426 will fail

comment:4 follow-up: ↓ 5 Changed 6 years ago by jwhitcraft

That patch does help but now it only inserts it at the end of the data even if the cursor is in the middle of some content that is there. The other thing I just noticed is that when you press cancel it doesn't return the cursor to your previous location like it did. I am thinking this is being caused by the contentEditable frame too.

comment:5 in reply to: ↑ 4 Changed 6 years ago by jwhitcraft

Replying to jwhitcraft:

That patch does help but now it only inserts it at the end of the data even if the cursor is in the middle of some content that is there. The other thing I just noticed is that when you press cancel it doesn't return the cursor to your previous location like it did. I am thinking this is being caused by the contentEditable frame too.

Strike that I was not using text copied out of word and I still had a older cached version of the fckdialog.html code. I still have the problem with the cancel button.

Changed 6 years ago by alfonsoml

Revised patch

comment:6 Changed 6 years ago by alfonsoml

I've changed the location of the changes so it happens whenever the call to Selection.Restore is gonna happen from a dialog.

comment:7 Changed 6 years ago by martinkou

  • Keywords Review+ added; Review? removed

comment:8 Changed 6 years ago by martinkou

  • Milestone set to FCKeditor 2.6.4

comment:9 Changed 6 years ago by jwhitcraft

That last patch does work when you press the cancel button it it doesn't restore the cursor to the previous position or selection when you hit cancel. It instead puts the cursor back at the first position in the editor.

comment:10 Changed 6 years ago by alfonsoml

Can you please verify that?

Use a the latest nightly with all the latest patches included (maybe some other one of them is also necessary), you might need to wait a little if you aren't using SVN to get the new build. Then apply the 2496_1.patch but you must not have the patch for #2469 included, it does breaks this functionality.

Close all the windows, clear the cache and try again.

comment:11 Changed 6 years ago by alfonsoml

  • Status changed from assigned to closed
  • Resolution set to fixed

I've waited a little but as there is no prove that there's a problem and the patch is working for me I've commited it with [2400].

I've included also a line that I forgot in the patch (it doesn't really affect the fix at hand) that makes the paste as plain text dialog set the focus in the textarea on load.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy