Quick fix for IE typing after generated content

The previous check was incorrect and was setting selection
too often.

Change-Id: I1ac393c149b6f814949b84e47faa04906c94f6af
This commit is contained in:
Christian Williams 2013-04-05 16:12:12 -07:00
parent 1513c23be6
commit de49bf2bf7

View file

@ -288,7 +288,8 @@ ve.ce.Surface.prototype.onDocumentKeyDown = function ( e ) {
selection = this.model.getSelection();
if ( selection.start !== 0 && selection.isCollapsed() ) {
prevNode = this.model.getDocument().getDocumentNode().getNodeFromOffset( selection.start - 1 );
if ( !prevNode.canHaveChildren() && !prevNode.canContainContent() ) {
// TODO: Check for generated content
if ( prevNode.type === 'MWimage' || prevNode.type === 'alienInline' ) {
this.model.change( null, new ve.Range( selection.start ) );
}
}