简体   繁体   English

每当我更改输入的焦点时,是什么导致这些输入框从这个简单的模式中抖动(仅在 chrome mobile 上)?

[英]What is causing these input boxes juddering (only at chrome mobile) from this simple modal whenever I change the focus of my input?

This issue is only can be seen at the mobile Chrome since the mobile keyboard needs to pop up.由于移动键盘需要弹出,因此此问题只能在移动 Chrome 上看到。

Whenever I switch the focus of my input from the 4 input boxes at the modal (whenever I change the place of the cursor inside the input box, like for example when you place a cursor at input box #1 from the input box #3 that is at the bottom of the input box #1), you can see the boxes juddering up and down.每当我从模态的 4 个输入框切换我的输入焦点时(每当我更改输入框内 cursor 的位置时,例如当您将 cursor 从输入框 #3 放置在输入框 #1 时位于输入框 #1 的底部),您可以看到这些框在上下晃动。

What is causing this issue and how to solve this (no shaking up and down when I change the focus) with those 4 inputs boxes placed at center horizontally and vertically??是什么导致了这个问题以及如何解决这个问题(当我改变焦点时没有上下晃动)这 4 个输入框水平和垂直放置在中心? Do I have to use Javascript for this to resolve the issue or it can be solved by only css?我是否必须为此使用 Javascript 来解决问题,还是只能通过 css 来解决?

The sample code is at https://codesandbox.io/s/condescending-rhodes-uyv7wn and you should test the code at Chrome mobile through https://uyv7wn.csb.app/ which is hosted from the codesandbox.示例代码位于https://codesandbox.io/s/condescending-rhodes-uyv7wn ,您应该通过https://uyv7wn.csb.app/Chrome 移动版上测试代码,该地址由 codesandbox 托管。

I solved the issue by changing the input type from text to search and now it's working stable without juddering.我通过将输入类型从text更改为search解决了这个问题,现在它工作稳定,没有抖动。

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

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