mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 18:19:03 +08:00
修正积分抽屉顶部拖动区域绑定
This commit is contained in:
+18
-1
@@ -1471,6 +1471,20 @@ export const Home: React.FC<HomeProps> = ({ canEdit, isPortraitMode = false }) =
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const applyDrawerDragRegion = useCallback((open: boolean) => {
|
||||||
|
if (!open || typeof document === "undefined") return
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const drawerRoot = document.querySelector(".ss-operation-drawer")
|
||||||
|
if (!drawerRoot) return
|
||||||
|
|
||||||
|
const dragTargets = drawerRoot.querySelectorAll(".ant-drawer-header, .ant-drawer-title")
|
||||||
|
dragTargets.forEach((el) => el.setAttribute("data-tauri-drag-region", "true"))
|
||||||
|
|
||||||
|
const noDragTargets = drawerRoot.querySelectorAll(".ant-drawer-close, button, input")
|
||||||
|
noDragTargets.forEach((el) => el.removeAttribute("data-tauri-drag-region"))
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -1629,12 +1643,15 @@ export const Home: React.FC<HomeProps> = ({ canEdit, isPortraitMode = false }) =
|
|||||||
|
|
||||||
{isPortraitMode ? (
|
{isPortraitMode ? (
|
||||||
<Drawer
|
<Drawer
|
||||||
title={t("home.operationTitle", { name: selectedStudent?.name })}
|
title={
|
||||||
|
<div data-tauri-drag-region>{t("home.operationTitle", { name: selectedStudent?.name })}</div>
|
||||||
|
}
|
||||||
className="ss-operation-drawer"
|
className="ss-operation-drawer"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
height="100%"
|
height="100%"
|
||||||
open={operationVisible}
|
open={operationVisible}
|
||||||
onClose={() => setOperationVisible(false)}
|
onClose={() => setOperationVisible(false)}
|
||||||
|
afterOpenChange={applyDrawerDragRegion}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
styles={{
|
styles={{
|
||||||
body: { padding: "12px 16px 24px", overflowX: "hidden" },
|
body: { padding: "12px 16px 24px", overflowX: "hidden" },
|
||||||
|
|||||||
Reference in New Issue
Block a user