Browse Source

The mousemove listener should not be executed when we're not selecting.

Piotrek Koszuliński 5 years ago
parent
commit
acd307941e

+ 1 - 1
packages/ckeditor5-table/src/tableselection/mouseselectionhandler.js

@@ -95,7 +95,7 @@ export default class MouseSelectionHandler {
 	 * @private
 	 */
 	_handleMouseMove( domEventData ) {
-		if ( !isButtonPressed( domEventData ) ) {
+		if ( !this._isSelecting || !isButtonPressed( domEventData ) ) {
 			this._tableSelection.stopSelection();
 
 			return;

+ 5 - 0
packages/ckeditor5-table/tests/manual/tableselection.html

@@ -12,6 +12,11 @@
 	.external-source td, .external-source th {
 		border: solid 1px hsl(0, 0%, 85%);
 	}
+
+	/* It should not create entire viewport scroll. */
+	pre {
+		overflow: auto;
+	}
 </style>
 
 <h3>A "content" test editor</h3>

+ 1 - 1
packages/ckeditor5-table/theme/table.css

@@ -26,7 +26,7 @@
 		& th {
 			min-width: 2em;
 			padding: .4em;
-			border-color: hsl(0, 0%, 85%);
+			border-color: hsl(0, 0%, 75%);
 		}
 
 		& th {