mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
fix: table itemActions 左右滚动位置问题修复 (#5746)
* fix: table itemActions 左右滚动位置问题修复 * 修改 * 修改
This commit is contained in:
parent
f8b53a715c
commit
34e7b3cd42
@ -70,8 +70,18 @@ export interface TableContentProps extends LocaleProps {
|
||||
|
||||
@observer
|
||||
export class TableContent extends React.Component<TableContentProps> {
|
||||
renderItemActions() {
|
||||
const {itemActions, render, store, classnames: cx} = this.props;
|
||||
static renderItemActions(
|
||||
props: Pick<
|
||||
TableContentProps,
|
||||
'itemActions' | 'render' | 'store' | 'classnames'
|
||||
>
|
||||
) {
|
||||
const {itemActions, render, store, classnames: cx} = props;
|
||||
|
||||
if (!store.hoverRow) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const finalActions = Array.isArray(itemActions)
|
||||
? itemActions.filter(action => !action.hiddenOnHover)
|
||||
: [];
|
||||
@ -149,7 +159,6 @@ export class TableContent extends React.Component<TableContentProps> {
|
||||
className={cx('Table-content', className)}
|
||||
onScroll={onScroll}
|
||||
>
|
||||
{store.hoverRow ? this.renderItemActions() : null}
|
||||
<table ref={tableRef} className={tableClassName}>
|
||||
<thead>
|
||||
{columnsGroup.length ? (
|
||||
|
@ -2805,6 +2805,12 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
|
||||
return (
|
||||
<>
|
||||
{TableContent.renderItemActions({
|
||||
store,
|
||||
classnames: cx,
|
||||
render,
|
||||
itemActions
|
||||
})}
|
||||
<TableContent
|
||||
tableClassName={cx(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user