Fix Add List popup to not open after adding new board or there being no lists at all.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2026-03-12 04:39:51 +02:00
parent 89f86caf69
commit 7e378be1d8

View file

@ -212,29 +212,6 @@ Template.boardBody.onCreated(function () {
return boardView === 'board-view-lists';
};
this.openNewListForm = () => {
const openInlineFormButton = this.find('.js-list-composer .js-open-inlined-form');
if (openInlineFormButton) {
openInlineFormButton.click();
return;
}
const boardCanvas = this.find('.board-canvas') || this.firstNode;
if (boardCanvas) {
Popup.open('addList').call(
Utils.getCurrentBoard(),
{
currentTarget: boardCanvas,
target: boardCanvas,
preventDefault() {},
},
{
dataContextIfCurrentDataIsUndefined: Utils.getCurrentBoard(),
},
);
}
};
// fix swimlanes sort field if there are null values
const currentBoardData = Utils.getCurrentBoard();
if (currentBoardData && Swimlanes) {
@ -626,13 +603,6 @@ Template.boardBody.onRendered(function () {
}
});
// If there is no data in the board (ie, no lists) we autofocus the list
// creation form by clicking on the corresponding element.
const currentBoard = Utils.getCurrentBoard();
if (Utils.canModifyBoard() && currentBoard.lists().length === 0) {
tpl.openNewListForm();
}
dragscroll.reset();
Utils.setBackgroundImage();
});