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 }))} />