简体   繁体   English

固定元素 Y 位置在 android 的 chrome 上滚动后计算错误

[英]Fixed element Y position calculated wrong after scroll on chrome for android

Happens when address bar becomes hidden/visible.当地址栏变得隐藏/可见时发生。

在此处输入图片说明

The element marked on the DOM explorer is the same element shown on the bottom of the screen (with the "Start Planning" button). DOM 浏览器上标记的元素与屏幕底部显示的元素相同(带有“开始规划”按钮)。 After scroll it's actual location is being scrolled up (even though it is in fixed position), but no re-rendering occurs since it is still displayed on the screen in the correct position.滚动后,它的实际位置被向上滚动(即使它处于固定位置),但没有重新渲染发生,因为它仍然显示在屏幕上的正确位置。

The interesting thing is that the element does not respond to clicks in the displayed area but rather in the DOM calculated area (aka, if you click above the button it works but not when you click on the button itself).有趣的是,该元素不会响应显示区域中的点击,而是响应 DOM 计算区域中的点击(也就是说,如果您在按钮上方单击它会起作用,但当您单击按钮本身时则不会)。

Here is the link the page on our platform that has the issue:这是我们平台上有问题的页面的链接:

https://in-office.wekudo.com/wellness/category/nutrition/smoothie-bar https://in-office.wekudo.com/wellness/category/nutrition/smoothie-bar

Same issue exists also on Airbnb's platform: Airbnb 的平台上也存在同样的问题:

https://www.airbnb.com/rooms/select/17017021?search_id=74b85b09-c47b-4d33-854a-c42ffa1d7779&federated_search_id=93685a2b-81cc-49a4-9699-2e6adb1c1a25 https://www.airbnb.com/rooms/select/17017021?search_id=74b85b09-c47b-4d33-854a-c42ffa1d7779&federated_search_id=93685a2b-81cc-49a4-96991c1a62e

The bug seems to be related to hammer.js:该错误似乎与hammer.js有关:

https://github.com/hammerjs/hammer.js/issues/1171 https://github.com/hammerjs/hammer.js/issues/1171

在 CSS 中,请添加overflow-y: visible !important;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM