Opened 9 years ago

Last modified 9 years ago

#12873 confirmed New Feature

[IE] Improve copy/cup and paste binding

Reported by: Piotr Jasiun Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:


On IE are 2 problems with binding copy/cut and paste events:

  • there is no support to custom data type,
  • any access to clipboadData displays warning dialog to user, which we want to avoid.

Because of these problems on IE we do not bind copy/cut and paste events. Wherefore all paste events are recognize as external and user is not able to pass data from copy/cut to paste using dataTransfer facade (copy/cut dataTransfer object and paste dataTransfer object are 2 separate objects instead of one).

Fortunately in many cases we are able to guess the connection between copy/cut and paste events. On the one hand we can read selected HTML during copy/cut, on the other we can get pasted HTML from the paste event. Of course browser can modify that HTML structure, but the text should be the same. On paste we could remove all HTML tags from cut/copied and pasted HTML, remove all white characters and compare remaining text if it is longer then X characters (e.g. 10). This way we could bind most cases.

We could also handle some most popular cases with only HTML. For example if user copy/cut and paste single image we can read and compare both image source and alt and, if they are the same, bind events. Similarly we could check single widgets. We could also compare both HTML data. In some cases they may be the same.

Of course some cases will not be covered: if user cut and paste only HTML data (without any text) which is hard to compare, then the paste will be still recognized as external, but it means it will work as good/bad as it works now.

Change History (1)

comment:1 Changed 9 years ago by Piotr Jasiun

Status: newconfirmed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy