From 0f8dd44f5a24b03a1ad05203de62afd633f7a956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E9=87=8E?= Date: Mon, 9 Feb 2026 21:16:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8C=89=E9=92=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=B8=8E=E9=94=AE=E7=9B=98=E5=BC=B9=E5=87=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommonPopup/index.module.scss | 13 +++++++------ .../components/SelectStadium/StadiumDetail.tsx | 17 +++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/components/CommonPopup/index.module.scss b/src/components/CommonPopup/index.module.scss index 681b905..dcc4569 100644 --- a/src/components/CommonPopup/index.module.scss +++ b/src/components/CommonPopup/index.module.scss @@ -3,6 +3,12 @@ .common-popup { position: fixed; z-index: 9999 !important; + padding: 0; + box-sizing: border-box; + max-height: calc(100vh - 10px); + display: flex; + flex-direction: column; + background-color: theme.$page-background-color; &:global(.nut-popup-bottom.nut-popup-round) { border-radius: 20px 20px 0 0 !important; } @@ -32,12 +38,7 @@ } } - padding: 0; - box-sizing: border-box; - max-height: calc(100vh - 10px); - display: flex; - flex-direction: column; - background-color: theme.$page-background-color; + // .common-popup__header { // padding: 12px 16px; diff --git a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx index f57af93..f4c4b9d 100644 --- a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx +++ b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx @@ -72,6 +72,7 @@ const StadiumDetail = forwardRef(({ }, ref) => { const [openPicker, setOpenPicker] = useState(false); //为了解决上传图片时按钮样式问题 const [scrollTop, setScrollTop] = useState(0); + const [isTextareaFocused, setIsTextareaFocused] = useState(false); // 记录 TextareaTag 是否 focus const { getDictionaryValue } = useDictionaryActions() const court_type = getDictionaryValue('court_type') || [] const court_surface = getDictionaryValue('court_surface') || [] @@ -199,12 +200,12 @@ const StadiumDetail = forwardRef(({ } } - // 当键盘显示时触发 changeTextarea + // 当键盘显示且 TextareaTag 当前 focus 时才触发 changeTextarea useEffect(() => { - if (isKeyboardVisible) { + if (isKeyboardVisible && isTextareaFocused) { changeTextarea(true) } - }, [isKeyboardVisible]) + }, [isKeyboardVisible, isTextareaFocused]) const changePicker = (value:boolean) => { setOpenPicker(value); @@ -269,11 +270,15 @@ const StadiumDetail = forwardRef(({ { - //changeTextarea(true) updateFormData(item.prop, value) }} - // onBlur={() => changeTextarea(false)} - onFocus={() => changeTextarea(true)} + onBlur={() => { + setIsTextareaFocused(false) + }} + onFocus={() => { + setIsTextareaFocused(true) + changeTextarea(true) + }} placeholder='有其他场地信息可备注' options={(item.options || []).map((o) => ({ label: o, value: o }))} />