Opened 12 years ago

Closed 12 years ago

#9851 closed Bug (fixed)

selectionChange isn't fired when mouse selection finished outside editable

Reported by: Piotrek Koszuliński Owned by: Olek Nowodziński
Priority: Normal Milestone: CKEditor 4.0.2
Component: Core : Selection Version: 3.5.1
Keywords: Cc:

Description

Extracted from #9699.

  1. Focus editor.
  2. Check that selection is collapsed so cut/copy buttons are disabled.
  3. Start selection by dragging. Release mouse button outside editable. Check releasing mouse button over document, outside of it, outside body, but in html.
  4. Check cut/copy buttons state.
  • Expected: when selection changed from collapsed to not collapsed, then selectionChange should be fired and those buttons should change state.
  • Actual: in many cases they stay disabled.

Reproducible on Webkits, Opera, FF. After #9699 some cases may be fixed - usually those target by that patch. But even when issue from #9699 was fixed, I was sometimes able to reproduce this one.

Change History (11)

comment:1 Changed 12 years ago by Piotrek Koszuliński

Most likely on #9699 this issue is reproducible only when elements path hasn't been modified by the selection change. So to reproduce it select the same paragraph in which you placed caret in step 1.

comment:2 Changed 12 years ago by Piotrek Koszuliński

Perhaps related issue #9767.

comment:3 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: 4.0.1 (GitHub - master)3.5.1

I was able to reproduce this in all browsers from CKEditor 3.5.1 (when cut and copy buttons started reflected selection).

comment:4 Changed 12 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: confirmedassigned

comment:5 Changed 12 years ago by Olek Nowodziński

Status: assignedreview

Created a fix for the issue in t/9851@cksource that consists of two separate commits:

  • Fixed clipboard mouseup listener to handle out-of-editable cases when selection goes out of editable.
  • Fixed selection system to fire selectionChange event if selection process ends out of editable.

comment:6 Changed 12 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:7 Changed 12 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed

Fixed issue with git:b862b5f2dff723.

comment:8 Changed 12 years ago by Olek Nowodziński

Resolution: fixed
Status: closedreopened

git:b862b5f2dff723 changeset breaks clipboard behavior for divarea:

  1. Open divarea sample.
  2. Watch cut & copy buttons on the toolbar.
  3. Click somewhere outside of the editor.
  4. Cut & copy are enabled as if something was selected in the editor.

This is because checkSelectionChangeTimeout is now called when clicking the outer document. Cannot reproduce in framed editor.

comment:9 Changed 12 years ago by Olek Nowodziński

Status: reopenedreview

Created branch t/9851b@cksource with clipboard fix. Apparently, selection type should be determined by calling editor.getSelection().getType().

comment:10 Changed 12 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:11 Changed 12 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed
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