Won't Fix
Last Updated: 19 Apr 2022 13:50 by ADMIN
ADMIN
Marin Bratanov
Created on: 18 Jun 2018 11:07
Category: Editor
Type: Bug Report
0
In IE, after deleting a row with the context menu, typing puts content in the <tr> which results in invalid HTML
You can get the same behavior that all other browsers get - focus being after the table. This is done easily by clearing out the following function logic (make sure the script is after the script manager):

<script>
   Telerik.Web.UI.Editor.TableDeleteRow.prototype.selectAnotherRow = function () { }
</script>

You can also try the following version of the function that attempts to fix the selection collapse after the DOM changed:

<script>
Telerik.Web.UI.Editor.TableDeleteRow.prototype.selectAnotherRow = function (layoutBuilderEngine) {
    if ($telerik.isIE9Mode) {
        var arStateIndexes = layoutBuilderEngine._getLeftTopStateIndexes(layoutBuilderEngine._selectedRowIndex, layoutBuilderEngine._selectedCell.cellIndex);
        var stateRow = arStateIndexes["rowIndex"];
        var nextCell = layoutBuilderEngine._getSelectedTableCellByStateIndexes(stateRow + 1, 0);
        var prevCell = layoutBuilderEngine._getSelectedTableCellByStateIndexes(stateRow - 1, 0);
        var newSelectedCell = nextCell || prevCell;
        if (newSelectedCell) {
            var editorSelection = this.get_editor().getSelection();
            setTimeout(function () {
                try {//the DOM change is likely to cause errors after the fixes, hence the try-catch, the timeout is to let the DOM get changed before tampering with the selection
                    if ($telerik.$(newSelectedCell).is(':visible')) {//for deleting footer cells
                        editorSelection.selectElement(newSelectedCell);
                        editorSelection.moveToElementText(newSelectedCell);//to properly move focus
                        editorSelection.collapse(true);
                    }
                }
                catch (ex) { }
            });
        }
    }
}
</script>


Considering the drawbacks of fixing IE code that is also inconsistent with other browsers, it is possible that the final fix will be to remove the function and have the same behavior as in other browsers.
0 comments