Vanessa 2026-02-04 14:11:01 +08:00
parent 4326958da2
commit ba0cf1cf28
3 changed files with 23 additions and 10 deletions

View file

@ -259,7 +259,7 @@ export const getGroupTitleHTML = (group: IAVView, counter: number) => {
const renderGroupTable = (options: ITableOptions) => {
const searchInputElement = options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement;
const isSearching = searchInputElement && document.activeElement === searchInputElement;
const query = searchInputElement?.value || "";
const query = searchInputElement?.textContent || "";
let avBodyHTML = "";
options.data.view.groups.forEach((group: IAVTable) => {
@ -387,8 +387,8 @@ const afterRenderTable = (options: ITableOptions) => {
return;
}
const viewsElement = options.blockElement.querySelector(".av__views") as HTMLElement;
const searchInputElement = options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement;
searchInputElement.value = options.resetData.query || "";
const searchInputElement = options.blockElement.querySelector('[data-type="av-search"]') as HTMLElement;
searchInputElement.textContent = options.resetData.query || "";
if (options.resetData.isSearching) {
searchInputElement.focus();
}
@ -406,7 +406,7 @@ const afterRenderTable = (options: ITableOptions) => {
if (event.isComposing) {
return;
}
if (searchInputElement.value || document.activeElement === searchInputElement) {
if (searchInputElement.textContent || document.activeElement === searchInputElement) {
viewsElement.classList.add("av__views--show");
} else {
viewsElement.classList.remove("av__views--show");
@ -420,7 +420,7 @@ const afterRenderTable = (options: ITableOptions) => {
if (event.isComposing) {
return;
}
if (!searchInputElement.value) {
if (!searchInputElement.textContent) {
viewsElement.classList.remove("av__views--show");
searchInputElement.style.width = "0";
searchInputElement.style.paddingLeft = "0";
@ -532,7 +532,7 @@ export const avRender = async (element: Element, protyle: IProtyle, cb?: (data:
selectRowIds,
dragFillId,
activeIds,
query: searchInputElement?.value || "",
query: searchInputElement?.textContent || "",
pageSizes
};
if (e.firstElementChild.innerHTML === "") {