Browse Source

Fix: Error thrown when navigating into the table insertion panel using the keyboard.

Maciej Gołaszewski 7 years ago
parent
commit
1ed7481c89

+ 17 - 0
packages/ckeditor5-table/src/ui/inserttableview.js

@@ -17,6 +17,7 @@ import './../../theme/inserttable.css';
  * It renders a 10x10 grid to choose inserted table size.
  *
  * @extends module:ui/view~View
+ * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  */
 export default class InsertTableView extends View {
 	/**
@@ -122,6 +123,22 @@ export default class InsertTableView extends View {
 	}
 
 	/**
+	 * @inheritDoc
+	 */
+	focus() {
+		// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
+		// The method should be implemented while working on keyboard support for this view. See #22.
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	focusLast() {
+		// The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
+		// The method should be implemented while working on keyboard support for this view. See #22.
+	}
+
+	/**
 	 * Highlights grid boxes depending on rows & columns selected.
 	 *
 	 * @private

+ 5 - 0
packages/ckeditor5-table/tests/ui/inserttableview.js

@@ -54,6 +54,11 @@ describe( 'InsertTableView', () => {
 			expect( view.items ).to.have.length( 100 );
 		} );
 
+		it( 'should not throw error for DropdownPanelFocusable interface methods', () => {
+			expect( () => view.focus() ).to.not.throw();
+			expect( () => view.focusLast() ).to.not.throw();
+		} );
+
 		describe( 'view#items bindings', () => {
 			it( 'updates view#height & view#width on "over" event', () => {
 				const boxView = view.items.get( 0 );