Opened 9 years ago

Closed 9 years ago

#12007 closed defect (fixed)

Editor EnterKeyHandling plugin will fail if using copy and paste in IE

Reported by: Katie Vance Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.6
Component: Editor Version: 1.5
Keywords: IE, editor, EnterKeyHandling Cc:
Blocked By: Blocking:

Description (last modified by bill)

In IE, the EnterKeyHandling plugin doesn't work correctly if you copy and paste a selection and then hit enter.

Steps to reproduce:

  1. Open tests\editor\EnterKeyHandling?.html
  2. In the blockNodeforEnter='DIV' editor window, select all the text and delete it.
  3. Type in anything.
  4. Copy all or part of what you typed and paste it after itself.
  5. Hit Enter.

The text will be split incorrectly. You can see other similar behavior if you paste a couple of times and hit enter from the middle of the text.

This will fail for all three, div, p, and br.

Attachments (2)

editor_12007.patch (13.4 KB) - added by Katie Vance 9 years ago.
Patch for div and p only
editor_12007_2.patch (5.9 KB) - added by Katie Vance 9 years ago.
Fix BR case

Download all attachments as: .zip

Change History (17)

comment:1 Changed 9 years ago by Jared Jurkiewicz

Owner: Jared Jurkiewicz deleted

comment:2 Changed 9 years ago by Katie Vance

The reason it fails is because in IE, once you do a paste it will create a new separate text node for each paste. The algorithm isn't using the correct text node when it determines where to place the div, p, or br.

Attaching a patch with tests for the div and p case. The br case is a bit more complicated and on top of that, when I perform those steps within the br editor, IE crashes. I created ticket #12008 to track that as a separate issue issue.

Changed 9 years ago by Katie Vance

Attachment: editor_12007.patch added

Patch for div and p only

comment:3 Changed 9 years ago by Jared Jurkiewicz

(In [23268]) Fix for repeated enter presses. \!strict refs #12007

comment:4 Changed 9 years ago by Jared Jurkiewicz

ksv:

I've applied/checked in this. I've also fixed 12008, and worked around the error with IE (by avoiding the whole empty node mess). So, you can probably wokr on a fix for IE for that one now.

Changed 9 years ago by Katie Vance

Attachment: editor_12007_2.patch added

Fix BR case

comment:5 Changed 9 years ago by Katie Vance

Attached the fix for the BR case as well. However, when I tested on webkit browsers I found that the copy and paste does not work as expected and breaks this plugin. Therefore, the new tests that I added are skipped for webkit browsers until #12024 is fixed.

comment:6 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [23329]) Fixing BR enterkey issue. \!strict fixes #12007

comment:7 Changed 9 years ago by Adam Peller

Milestone: tbd1.6

comment:8 Changed 9 years ago by bill

Resolution: fixed
Status: closedreopened

Starting with [23268] the EnterKeyHandling?.html test fails on safari, both mac and windows.

comment:9 Changed 9 years ago by bill

Owner: set to Jared Jurkiewicz
Status: reopenednew

comment:10 Changed 9 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to Katie Vance

Katy,

Please look into this, as these patches were yours.

comment:11 Changed 9 years ago by Jared Jurkiewicz

Owner: changed from Katie Vance to Jared Jurkiewicz

comment:12 Changed 9 years ago by Jared Jurkiewicz

(In [23499]) ctrl-c on mac in safari converts to <h3> it doesn't copy. Odd. Also, safari sometimes leaves a trailing BR. Updated testcase to acount for both and use the right meta key when on mac. refs #12007

comment:13 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

Reran UT on Windows and mac. Both pass with the tweaks. Closing bug again.

comment:14 Changed 9 years ago by bill

Description: modified (diff)
Resolution: fixed
Status: closedreopened

Thanks, that fixes mac/safari and mac/FF. Unfortunately, still failing in the copy/paste tests on mac/chrome. Windows looks OK.

comment:15 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: reopenedclosed

(In [23527]) Remove odd WebKit? insertion of meta tag on copy/paste. Hopefully this is the last one. \!strict fixes #12007

Note: See TracTickets for help on using tickets.