diff --git a/packages/kami-design/components/Overlay/index.tsx b/packages/kami-design/components/Overlay/index.tsx index cd1079ee3..9c55682b2 100644 --- a/packages/kami-design/components/Overlay/index.tsx +++ b/packages/kami-design/components/Overlay/index.tsx @@ -18,14 +18,13 @@ interface OverLayProps { darkness?: number blur?: boolean zIndex?: number + stopPropagation?: boolean } export type OverlayProps = OverLayProps & { show: boolean children?: ReactNode - zIndex?: number - standaloneWrapperClassName?: string } @@ -35,10 +34,10 @@ const OverLay: FC = (props) => { show, blur, center, - darkness, standaloneWrapperClassName, zIndex, + stopPropagation, } = props const isClient = useIsClient() @@ -108,7 +107,12 @@ const OverLay: FC = (props) => { : undefined } > -
+
{ + stopPropagation ? e.stopPropagation() : stopEventDefault(e) + }} + tabIndex={-1} + > {props.children}
diff --git a/src/components/in-page/Home/section.tsx b/src/components/in-page/Home/section.tsx index 94ccf58b3..948e30e26 100644 --- a/src/components/in-page/Home/section.tsx +++ b/src/components/in-page/Home/section.tsx @@ -110,7 +110,7 @@ const _Sections: FC = ({ notes, posts }) => { }, [])} /> getRandomUnRepeatImage(), [])} href={'/like_this'} diff --git a/src/pages/recently/index.tsx b/src/pages/recently/index.tsx index 799a7b563..7e174f44f 100644 --- a/src/pages/recently/index.tsx +++ b/src/pages/recently/index.tsx @@ -138,7 +138,7 @@ const RecentlyPage: NextPage = () => { } if (inView && hasNext) { - setFetchBefore(data[data.length - 1].id) + setFetchBefore(data[data.length - 1]?.id) } }, [data, hasNext, inView, loading]) @@ -161,6 +161,9 @@ const RecentlyPage: NextPage = () => { fixedWidth: true, useRootPortal: true, }, + overlayProps: { + stopPropagation: true, + }, component: ( <>