Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 处理table过滤输入失焦问题 #793

Merged
merged 3 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"ts-jest": "^27.1.2",
"ts-morph": "^13.0.02",
"ts-node": "^10.4.0",
"typescript": "^4.5.4",
"typescript": "~4.5.4",
"vite": "^2.9.9",
"vite-plugin-istanbul": "^2.3.0",
"vite-plugin-pwa": "^0.11.11",
Expand Down
4 changes: 2 additions & 2 deletions src/table/FilterController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface TableFilterControllerProps {
}

export default function TableFilterController(props: TableFilterControllerProps) {
const { tFilterValue, innerFilterValue, tableFilterClasses, isFocusClass, column, primaryTableElement } = props;
const { tFilterValue, innerFilterValue, tableFilterClasses, isFocusClass, column } = props;

const triggerElementRef = useRef<HTMLDivElement>(null);
const [locale, t] = useLocaleReceiver('table');
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function TableFilterController(props: TableFilterControllerProps)
const defaultFilterIcon = t(locale.filterIcon) || <FilterIcon />;
return (
<Popup
attach={primaryTableElement ? () => primaryTableElement : undefined}
// attach={primaryTableElement ? () => primaryTableElement : undefined}
visible={filterPopupVisible}
destroyOnClose
trigger="click"
Expand Down
1 change: 0 additions & 1 deletion src/table/PrimaryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export default function PrimaryTable(props: TPrimaryTableProps) {
const sortIcon = item.sorter ? renderSortIcon(p) : null;
const filterIcon = item.filter ? renderFilterIcon(p) : null;
const attach = primaryTableRef.current?.tableContentRef;
console.log(primaryTableRef.current?.tableContentRef);
return renderTitleWidthIcon([titleContent, sortIcon, filterIcon], p.col, p.colIndex, ellipsisTitle, attach);
};
item.ellipsisTitle = false;
Expand Down
1 change: 0 additions & 1 deletion src/table/hooks/useFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export default function useFilter(props: TdPrimaryTableProps, primaryTableRef: M
}

function onInnerFilterChange(val: any, column: PrimaryTableCol) {
console.log(val);
const filterValue = {
...innerFilterValue,
[column.colKey]: val,
Expand Down