Skip to content

Commit

Permalink
Merge pull request #793 from Tencent/fix/table-filter-input
Browse files Browse the repository at this point in the history
fix: 处理table过滤输入失焦问题
  • Loading branch information
honkinglin authored May 25, 2022
2 parents b3f7dfa + d6f5b36 commit 2c8ff2f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
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

0 comments on commit 2c8ff2f

Please sign in to comment.