Completed
Last Updated: 25 Nov 2016 15:48 by ADMIN
ADMIN
Rumen
Created on: 14 Nov 2016 08:20
Category: Editor
Type: Bug Report
1
Fix Thead and tfoot elements get deleted with deleting content of table
Thead and tfoot elements get deleted with deleting content of table in Google Chrome.

On the RadEditor demo page [http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx]

Replace the content with a table with a thead tbody tfoot caption

<table>
   <caption>ABC</caption>
   <thead>
      <tr>
         <th>A</th>
         <th>B</th>
         <th>C</th>
      </tr>
   </thead>
   <tfoot>
      <tr>
         <td>FOOT</td>
         <td>FOOT</td>
         <td>FOOT</td>
      </tr>
   </tfoot>
   <tbody>
      <tr>
         <td>A1</td>
         <td>B1</td>
         <td>C1</td>
      </tr>
      <tr>
         <td>A2</td>
         <td>B2</td>
         <td>C2</td>
      </tr>
      <tr>
         <td>A3</td>
         <td>B3</td>
         <td>C3</td>
      </tr>
   </tbody>
</table>

Select some content across the tbody, tfoot, thead and caption and delete 

Expected results: the content of the TD and TH should be remove

Actual results: the THEAD and TFOOT elements are removed

More details check the attached delete_thead_tfoot.gif file.

Workaround: 
<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>

<script>
	(function () {
		var $E = Telerik.Web.UI.Editor;
		var utils = $E.Utils;
		var cmdPrototype = $E.DeleteSelectionCommand.prototype;
		var shouldCollectNode = cmdPrototype.shouldCollectNode;
		cmdPrototype.shouldCollectNode = function (node) {
			return shouldCollectNode.call(this, node) && !utils.isTag(node, "thead") && !utils.isTag(node, "tfoot");
		};
	})();
</script>
Attached Files:
0 comments