From 3ba6a273c1fec6b8c7052b5dbdb34554425e63a3 Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Mon, 20 Jul 2020 17:18:06 +0200 Subject: [PATCH] Fixed (ui): Fixed a case when removing the first hidden toolbar button would throw an exception. Closes #7655. --- packages/ckeditor5-ui/src/toolbar/toolbarview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ckeditor5-ui/src/toolbar/toolbarview.js b/packages/ckeditor5-ui/src/toolbar/toolbarview.js index 340446697eb..c6f30528cd6 100644 --- a/packages/ckeditor5-ui/src/toolbar/toolbarview.js +++ b/packages/ckeditor5-ui/src/toolbar/toolbarview.js @@ -557,7 +557,7 @@ class DynamicGrouping { // Removing. for ( const removedItem of changeData.removed ) { - if ( index > this.ungroupedItems.length ) { + if ( index >= this.ungroupedItems.length ) { this.groupedItems.remove( removedItem ); } else { this.ungroupedItems.remove( removedItem );