浏览代码

Fixed (ui): Fixed a case when removing the first hidden toolbar button would throw an exception. Closes #7655.

Marek Lewandowski 5 年之前
父节点
当前提交
3ba6a273c1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/ckeditor5-ui/src/toolbar/toolbarview.js

+ 1 - 1
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 );