Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup 弹出层 useLockScroll 锁滚动 #6253

Closed
19Qingfeng opened this issue Jul 16, 2023 · 0 comments
Closed

Popup 弹出层 useLockScroll 锁滚动 #6253

19Qingfeng opened this issue Jul 16, 2023 · 0 comments
Labels

Comments

@19Qingfeng
Copy link
Contributor

Version of antd-mobile

5.31.1

Operating system and its version

iOS

Browser and its version

chrome 114.0.5735.198

Sandbox to reproduce

No response

What happened?

这是一个从用户层面难以复现的 Bug,但是他的确可能会产生错误交互方式。同时,我相信绝大多数 QA 以及用户或者是开发也难以复现。

Popup 组件,当前元素存在滚动条,同时父元素也存在滚动条时。元素存在滚动时情况下。传递 disableBodyScroll true,此时由于 ScrollTop 算作小数点时浏览器仍然会认为当前元素滚动到顶部/底部。

此时,由于 utils/use-lock-scroll.ts 中的 scrollTop + offsetHeight >= scrollHeight 计算元素是否滚动到底部并不准确:

image

我不确定为何会出现这样的结果,touchmove 中的 scrollTop 和实际元素的 scrollTop 表示不一致,但是的确会造成 disableBodyScroll 情况下拖拽可能影响最近的父元素同时被拖动。

Relevant log output

No response

@19Qingfeng 19Qingfeng added the bug label Jul 16, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Jul 16, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Jul 23, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Jul 23, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Aug 7, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Aug 9, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Aug 9, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Aug 9, 2023
19Qingfeng added a commit to 19Qingfeng/ant-design-mobile that referenced this issue Aug 10, 2023
zombieJ pushed a commit that referenced this issue Aug 10, 2023
)

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll test case #6253

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll with strict params #6253

* test: useLockScroll with strict params #6253

* fix: del px and remove {} #6253
miracles1919 added a commit that referenced this issue Aug 16, 2023
* docs: update doc of  SwipeAction ProgressBar ProgressCircle Popover Switch  (#6232)

* doc: update SwupeAction doc

* doc: update ProgressBar  ProgressCircle doc

* doc: update Popover doc

* doc: update Switch doc

* test: fix failed test (#6227)

* doc: Improve doc descriptions of some components (#6233)

* doc: update docs

* doc: update doc

* fix: virtual input value 0 (#6231)

* fix: fix placeholder show when value is number 0 on virtual-input

* test: add value `0`

---------

Co-authored-by: wuguangsen.wgs <[email protected]>
Co-authored-by: miracles1919 <[email protected]>

* fix(TextArea): hidden textarea element is not positioned relative to its parent (#6239)

fix: hidden textarea element is not positioned relative to its parent

* chore: bump 5.32.0

* enhance: useWheel dir change (#6240)

* enhance: useWheel dir change

* enhance: 代码风格调整

* refactor: 数组解构方式优化

* style: delete note code

* chore: prompt when repairing step cloneElement (#6259)

* fix(TextArea): reset rows when rows exceed autoSize (#6256)

* fix(TextArea): rows should be the smallest of default and autoSize

* refactor: adjust rows logic

* chore: side add type specification (#6258)

* chore: type enhance (#6262)

* refactor: to simplify the judge (#6263)

* refactor: to simplify the judge

* refactor: simplify the judge

* fix: add null judge

* fix: add judage case

* chore: repair type warning (#6267)

* fix: classname use repeatedly (#6278)

* chore: form's code style optimization (#6279)

* refactor(Calendar): change locale from method to string (#6276)

* refactor(Calendar): change locale from method to string

* test(ConfigProvider): remove spaces in Japanese translation in calendar

---------

Co-authored-by: litaoq <[email protected]>

* chore: add `--inactive-color-half` type (#6281)

* enhance: passive and preventDefault coexist repair (#6284)

* enhance: passive and preventDefault coexist repair

* refactor: code simplify

* test: add useLockScroll test case

* chore: pick type to InputHTMLAttributes (#6290)

* enhance(toast): compatible with rtl mode (#6287)

fix(toast): compatible with rtl mode

Co-authored-by: Fog3211 <[email protected]>

* test(useLockScroll): update test (#6292)

* fix: repir passive and preventDefault in components (#6296)

enhance: fix passive and preventDefault in components

* chore: eventOptions  type fix (#6298)

chore: type fix

* enhance: floating-panel add classPrefix (#6297)

* chore: code simplify (#6295)

* chore: code simplify

* chore: code simplify

* fix: useLockScroll whether the element scroll is in the end #6253 (#6254)

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll test case #6253

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll with strict params #6253

* test: useLockScroll with strict params #6253

* fix: del px and remove {} #6253

* fix: error-block Normal display 0 (#6309)

* fix: error-block Normal display 0

* test: add test case

* chore: center-popup use classPrefix (#6305)

* chore: pickview use classPrefix (#6304)

chore: pickview dom use classPrefix

* enhance: replace missing colors with css variables. fix #6319 (#6320)

* enhance: replace missing colors with css variables. fix #6319

* enhance: replace black color with css variable

* chore: update tag snapshots for css var

---------

Co-authored-by: Wing <[email protected]>
Co-authored-by: WuLiSenSen <[email protected]>
Co-authored-by: wuguangsen.wgs <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 二货机器人 <[email protected]>
Co-authored-by: whwnow <[email protected]>
Co-authored-by: litaoq <[email protected]>
Co-authored-by: Hyden Liu <[email protected]>
Co-authored-by: Fog3211 <[email protected]>
Co-authored-by: Fog3211 <[email protected]>
Co-authored-by: wang.haoyu <[email protected]>
Co-authored-by: Wuma <[email protected]>
zombieJ added a commit that referenced this issue Aug 17, 2023
* docs: update doc of  SwipeAction ProgressBar ProgressCircle Popover Switch  (#6232)

* doc: update SwupeAction doc

* doc: update ProgressBar  ProgressCircle doc

* doc: update Popover doc

* doc: update Switch doc

* test: fix failed test (#6227)

* doc: Improve doc descriptions of some components (#6233)

* doc: update docs

* doc: update doc

* fix: virtual input value 0 (#6231)

* fix: fix placeholder show when value is number 0 on virtual-input

* test: add value `0`

---------

Co-authored-by: wuguangsen.wgs <[email protected]>
Co-authored-by: miracles1919 <[email protected]>

* fix(TextArea): hidden textarea element is not positioned relative to its parent (#6239)

fix: hidden textarea element is not positioned relative to its parent

* chore: bump 5.32.0

* enhance: useWheel dir change (#6240)

* enhance: useWheel dir change

* enhance: 代码风格调整

* refactor: 数组解构方式优化

* style: delete note code

* chore: prompt when repairing step cloneElement (#6259)

* fix(TextArea): reset rows when rows exceed autoSize (#6256)

* fix(TextArea): rows should be the smallest of default and autoSize

* refactor: adjust rows logic

* chore: side add type specification (#6258)

* chore: type enhance (#6262)

* refactor: to simplify the judge (#6263)

* refactor: to simplify the judge

* refactor: simplify the judge

* fix: add null judge

* fix: add judage case

* chore: repair type warning (#6267)

* fix: classname use repeatedly (#6278)

* chore: form's code style optimization (#6279)

* refactor(Calendar): change locale from method to string (#6276)

* refactor(Calendar): change locale from method to string

* test(ConfigProvider): remove spaces in Japanese translation in calendar

---------

Co-authored-by: litaoq <[email protected]>

* chore: add `--inactive-color-half` type (#6281)

* enhance: passive and preventDefault coexist repair (#6284)

* enhance: passive and preventDefault coexist repair

* refactor: code simplify

* test: add useLockScroll test case

* chore: pick type to InputHTMLAttributes (#6290)

* enhance(toast): compatible with rtl mode (#6287)

fix(toast): compatible with rtl mode

Co-authored-by: Fog3211 <[email protected]>

* test(useLockScroll): update test (#6292)

* fix: repir passive and preventDefault in components (#6296)

enhance: fix passive and preventDefault in components

* chore: eventOptions  type fix (#6298)

chore: type fix

* enhance: floating-panel add classPrefix (#6297)

* chore: code simplify (#6295)

* chore: code simplify

* chore: code simplify

* fix: useLockScroll whether the element scroll is in the end #6253 (#6254)

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll test case #6253

* fix: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll whether the element scroll is in the end #6253

* test: useLockScroll with strict params #6253

* test: useLockScroll with strict params #6253

* fix: del px and remove {} #6253

* fix: error-block Normal display 0 (#6309)

* fix: error-block Normal display 0

* test: add test case

* feat: support for incoming ref to image-uploader #6289

* fix: remove imageUploaderRef openPhoto #6316

* fix: remove log ref:#6316

* doc: update

* feat: export image upload ref

* doc: update demo

---------

Co-authored-by: Wing <[email protected]>
Co-authored-by: miracles1919 <[email protected]>
Co-authored-by: WuLiSenSen <[email protected]>
Co-authored-by: wuguangsen.wgs <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: 二货机器人 <[email protected]>
Co-authored-by: whwnow <[email protected]>
Co-authored-by: litaoq <[email protected]>
Co-authored-by: Hyden Liu <[email protected]>
Co-authored-by: Fog3211 <[email protected]>
Co-authored-by: Fog3211 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant