﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11468	[iOS] Toolbar status doesn't update on iOS	zacaway		"Using current CKEditor standard editor demo on an iOS device (tested on iPad 2 with iOS 7.0.4):

1. Position the cursor on the first word in the first paragraph (""Apollo"") which is formatted bold.
1. Observe the 'B' toolbar button is correctly show depressed.
1. Move the cursor somewhere else in the paragraph that is not bold.
1. Observe the 'B' toolbar button still shows bold, event though the cursor is not on bold text.

This problem seems to be consistent across all tools on the toolbar; they are not updating when the selection changes.

The problem seems to be that CKEditor is attaching to the DOM selectionchange event on the editable element (around selection.js:387) but according to http://help.dottoro.com/ljixpxji.php, the selectionchange event is only valid when attached to the document object (not any element).

I've worked around this problem outside CKEditor using something like this, which fixes the problem:

{{{#!js
this.editor.document.on('selectionchange', function () {
  var selection = this.editor.getSelection(),
    path = selection && new CKEDITOR.dom.elementPath(
      selection.getStartElement(),
      selection.root
    );

    this.editor.fire('selectionChange', {
      selection: selection,
      path: path
    });
  }, this);
}}}"	Bug	new	Normal		Core : Selection			iOS	
