Преглед на файлове

Remove checking position equality when sorting ranges of selected table cells.

Maciej Gołaszewski преди 5 години
родител
ревизия
99e8d8b6a7
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. 3 4
      packages/ckeditor5-table/src/utils.js

+ 3 - 4
packages/ckeditor5-table/src/utils.js

@@ -167,9 +167,8 @@ function compareRangeOrder( rangeA, rangeB ) {
 	const posA = rangeA.start;
 	const posB = rangeB.start;
 
-	if ( posA.isEqual( posB ) ) {
-		return 0;
-	}
-
+	// Checking for equal position (returning 0) is not needed because this would be either:
+	// a. Intersecting range (not allowed by model)
+	// b. Collapsed range on the same position (allowed by model but should not happen).
 	return posA.isBefore( posB ) ? -1 : 1;
 }