简体   繁体   English

iOS Safari:点击结束后点击突出显示(-webkit-tap-highlight)卡在屏幕上

[英]iOS Safari: tap highlight (-webkit-tap-highlight) gets stuck on screen after tap end

Pretty simple problem: my single-page app has the normal WebKit tap highlight on Safari, so a translucent gray box appears and disappears when you tap.非常简单的问题:我的单页应用程序在 Safari 上具有正常的 WebKit 点击突出显示,因此当您点击时会出现一个半透明的灰色框并消失。 This is normal Safari behavior and is desired.这是正常的 Safari 行为,是需要的。

Sometimes, on an iPad, the gray box appears but does not disappear;有时,在 iPad 上,灰色框出现但不消失; the button tap goes through and the effects of the button are performed as expected (say, changing route) but the gray box remains until you tap again.按钮点击通过并且按钮的效果按预期执行(例如,更改路线)但灰色框仍然存在,直到您再次点击。

The gray box is not in the DOM - I'm nearly certain that it's Safari's tap highlight and not something we have added.灰色框不在 DOM 中——我几乎可以肯定它是 Safari 的点击突出显示,而不是我们添加的东西。

Counteracting "sticky hover" with @media hover(hover) { hover styles here } does nothing, so I don't believe this is a sticky hover issue.@media hover(hover) { hover styles here }抵消“粘滞悬停”没有任何作用,所以我不认为这是一个粘滞的 hover 问题。

Disabling the tap highlight with -webkit-tap-highlight: transparent;使用-webkit-tap-highlight: transparent; fixes the problem by making all tap highlights go away.通过使所有水龙头突出显示 go 消失来解决问题。 This is not a great solution.这不是一个很好的解决方案。 The desired behavior is to have the tap highlights, and have them behave correctly.期望的行为是让点击突出显示,并让它们行为正确。

This is a relatively new problem, so I assume we did something to cause this behavior, but I can't figure out what.这是一个相对较新的问题,所以我认为我们做了一些事情来导致这种行为,但我不知道是什么。 Any ideas?有任何想法吗?

Thanks!谢谢!

We had a similar problem when opening a web view in our flutter app on IOS, The issue was caused by Wrapping our entire app in a gesture detector which caused the -webkit-tap-highlight to get stuck on screen.在 IOS 上的 flutter 应用程序中打开 web 视图时,我们遇到了类似的问题,该问题是由于将我们的整个应用程序包装在手势检测器中导致 -webkit-tap-highlight 卡在屏幕上。

Not sure what stack you're using but hopefully this helps you or anyone with similar issues get it resolved.不确定您使用的是什么堆栈,但希望这可以帮助您或任何有类似问题的人解决它。

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

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