🎨 有过滤条件,添加新行后,编辑单元格使其被过滤,tab 切换到日期后 enter 弹出的日期面板需隐藏

This commit is contained in:
Vanessa 2025-07-01 23:25:50 +08:00
parent 3595312920
commit 1355308133

View file

@ -325,18 +325,21 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex,
const newCellElement = e.querySelector(`.av__row[data-id="${selectCellId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${selectCellId.split(Constants.ZWSP)[1]}"]`); const newCellElement = e.querySelector(`.av__row[data-id="${selectCellId.split(Constants.ZWSP)[0]}"] .av__cell[data-col-id="${selectCellId.split(Constants.ZWSP)[1]}"]`);
if (newCellElement) { if (newCellElement) {
newCellElement.classList.add("av__cell--select"); newCellElement.classList.add("av__cell--select");
cellScrollIntoView(e, newCellElement);
} }
const avMaskElement = document.querySelector(".av__mask"); const avMaskElement = document.querySelector(".av__mask");
const avPanelElement = document.querySelector(".av__panel");
if (avMaskElement) { if (avMaskElement) {
(avMaskElement.querySelector("textarea, input") as HTMLTextAreaElement)?.focus(); (avMaskElement.querySelector("textarea, input") as HTMLTextAreaElement)?.focus();
} else if (!document.querySelector(".av__panel") && !isSearching && getSelection().rangeCount > 0) { } else if (!avPanelElement && !isSearching && getSelection().rangeCount > 0) {
const range = getSelection().getRangeAt(0); const range = getSelection().getRangeAt(0);
const blockElement = hasClosestBlock(range.startContainer); const blockElement = hasClosestBlock(range.startContainer);
if (blockElement && e.isSameNode(blockElement)) { if (blockElement && e.isSameNode(blockElement)) {
focusBlock(e); focusBlock(e);
} }
} else if (avPanelElement && !newCellElement) {
avPanelElement.remove();
} }
cellScrollIntoView(e, newCellElement);
} }
selectRowIds.forEach((selectRowId, index) => { selectRowIds.forEach((selectRowId, index) => {
const rowElement = e.querySelector(`.av__row[data-id="${selectRowId}"]`) as HTMLElement; const rowElement = e.querySelector(`.av__row[data-id="${selectRowId}"]`) as HTMLElement;