mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:06:47 +00:00
fix: press enter to reload when the Pagination is focused (#1720)
This commit is contained in:
parent
a5b4684a48
commit
3e2b0a3e89
@ -1,6 +1,6 @@
|
|||||||
import { observer } from '@formily/react';
|
import { observer } from '@formily/react';
|
||||||
import { Pagination as AntdPagination } from 'antd';
|
import { Pagination as AntdPagination } from 'antd';
|
||||||
import React from 'react';
|
import React, { KeyboardEventHandler } from 'react';
|
||||||
import { useProps } from '../../hooks/useProps';
|
import { useProps } from '../../hooks/useProps';
|
||||||
|
|
||||||
export const Pagination = observer((props: any) => {
|
export const Pagination = observer((props: any) => {
|
||||||
@ -8,5 +8,15 @@ export const Pagination = observer((props: any) => {
|
|||||||
if (hidden) {
|
if (hidden) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return <AntdPagination {...others} />;
|
const onKeypress: KeyboardEventHandler<HTMLDivElement> = (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div onKeyPress={onKeypress}>
|
||||||
|
<AntdPagination {...others} />;
|
||||||
|
</div>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user