From 9e741b45350d0c393f4bfa99fa7feae48db38311 Mon Sep 17 00:00:00 2001 From: JImmy <59650459+okesseko@users.noreply.github.com> Date: Wed, 20 Aug 2025 11:00:20 +0800 Subject: [PATCH 1/2] fix: maxRows and maxCols typo --- src/table.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/table.js b/src/table.js index 7dc31fd8..b273a019 100644 --- a/src/table.js +++ b/src/table.js @@ -187,7 +187,7 @@ export default class Table { label: this.api.i18n.t('Add column to left'), icon: IconDirectionLeftDown, hideIf: () => { - return this.numberOfColumns === this.config.maxcols + return this.numberOfColumns === this.config.maxCols }, onClick: () => { this.addColumn(this.selectedColumn, true); @@ -198,7 +198,7 @@ export default class Table { label: this.api.i18n.t('Add column to right'), icon: IconDirectionRightDown, hideIf: () => { - return this.numberOfColumns === this.config.maxcols + return this.numberOfColumns === this.config.maxCols }, onClick: () => { this.addColumn(this.selectedColumn + 1, true); @@ -242,7 +242,7 @@ export default class Table { label: this.api.i18n.t('Add row above'), icon: IconDirectionUpRight, hideIf: () => { - return this.numberOfRows === this.config.maxrows + return this.numberOfRows === this.config.maxRows }, onClick: () => { this.addRow(this.selectedRow, true); @@ -253,7 +253,7 @@ export default class Table { label: this.api.i18n.t('Add row below'), icon: IconDirectionDownRight, hideIf: () => { - return this.numberOfRows === this.config.maxrows + return this.numberOfRows === this.config.maxRows }, onClick: () => { this.addRow(this.selectedRow + 1, true); @@ -366,7 +366,7 @@ export default class Table { * Check if the number of columns has reached the maximum allowed columns specified in the configuration, * and if so, exit the function to prevent adding more columns beyond the limit. */ - if (this.config && this.config.maxcols && this.numberOfColumns >= this.config.maxcols) { + if (this.config && this.config.maxCols && this.numberOfColumns >= this.config.maxCols) { return; } @@ -398,7 +398,7 @@ export default class Table { } const addColButton = this.wrapper.querySelector(`.${CSS.addColumn}`); - if (this.config?.maxcols && this.numberOfColumns > this.config.maxcols - 1 && addColButton ){ + if (this.config?.maxCols && this.numberOfColumns > this.config.maxCols - 1 && addColButton ){ addColButton.classList.add(CSS.addColumnDisabled); } this.addHeadingAttrToFirstRow(); @@ -429,7 +429,7 @@ export default class Table { * Check if the number of rows has reached the maximum allowed rows specified in the configuration, * and if so, exit the function to prevent adding more columns beyond the limit. */ - if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && addRowButton) { + if (this.config && this.config.maxRows && this.numberOfRows >= this.config.maxRows && addRowButton) { return; } @@ -454,7 +454,7 @@ export default class Table { } const addRowButton = this.wrapper.querySelector(`.${CSS.addRow}`); - if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && addRowButton) { + if (this.config && this.config.maxRows && this.numberOfRows >= this.config.maxRows && addRowButton) { addRowButton.classList.add(CSS.addRowDisabled); } return insertedRow; From 2a5902748a87fcfb349f5de3a14d4f3dc9993762 Mon Sep 17 00:00:00 2001 From: JImmy <59650459+okesseko@users.noreply.github.com> Date: Fri, 12 Sep 2025 19:39:55 +0800 Subject: [PATCH 2/2] chore: bump patch version to 2.4.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ad36fef..1e41bbf6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@editorjs/table", "description": "Table for Editor.js", - "version": "2.4.5", + "version": "2.4.6", "license": "MIT", "repository": "https://github.com/editor-js/table", "files": [