Ticket #8617: 8617-2.patch

File 8617-2.patch, 1.1 KB (added by fdintino, 12 years ago)
  • _source/plugins/selection/plugin.js

     
    182182                                editor.on( 'beforeSetMode', function() { removeFillingChar( editor.document ); } );
    183183                                editor.on( 'key', function( e )
    184184                                        {
     185                                                // Create a bookmark for the cursor so we can restore its position
     186                                                // after removing the filling character.
     187                                                //
     188                                                // See #8617 Cursor jumps on Backspace in Chrome
     189                                                // http://dev.ckeditor.com/ticket/8617
     190                                                var selection = editor.getSelection();
     191                                                var bookmark = ( selection ) ? selection.createBookmarks() : null;
     192
    185193                                                // Remove the filling char before some keys get
    186194                                                // executed, so they'll not get blocked by it.
    187195                                                switch ( e.data.keyCode )
     
    193201                                                        case 8 :        // BACKSPACE
    194202                                                                removeFillingChar( editor.document );
    195203                                                }
     204
     205                                                if ( bookmark )
     206                                                        selection.selectBookmarks( bookmark );
    196207                                        }, null, null, 10 );
    197208
    198209                                var fillingCharBefore,
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy