当前位置:网站首页>App embedded H5 --- iPhone soft keyboard blocks input text
App embedded H5 --- iPhone soft keyboard blocks input text
2022-07-07 05:01:00 【Kratial】
1. The cause of the problem
stay ios in , The soft keyboard is at the top of the page , The pop-up of the soft keyboard will not cause the height of the window to change , Therefore, the input box at the bottom will be blocked .
But in android Next , The soft keyboard is on the same level as the window , So when the soft keyboard pops up , The current window will change , Therefore, there is no such problem .
2. How to monitor the pop-up and hiding of soft keyboard
stay ios The soft keyboard will pop up when you focus in , When the focus is lost, the soft keyboard will be folded
3. Solution
(1)scrollIntoView
(2) Monitor focus and out of focus
(3) Use this scrollIntoView, Ensure that the current input box is outside the original visual area
handleFocus(elem) {
console.log(' The soft keyboard pops up ')
document.body.style.height = '100vh' + Soft keyboard height
document.querySelector('.' + elem).scrollIntoView();
}
},
handleBlur() {
document.body.style.height = '100%'
console.log(' Soft keyboard hidden ')
}
4. About scrollIntoView Introduction to
Element Interface scrollIntoView() Method scrolls the parent container of the element , Cause to be called scrollIntoView() The element is visible to the user .
Reference link :MDN—scrollIntoView
边栏推荐
- DFS and BFS concepts and practices +acwing 842 arranged numbers (DFS) +acwing 844 Maze walking (BFS)
- 动态生成表格
- STM32 encapsulates the one key configuration function of esp8266: realize the switching between AP mode and sta mode, and the creation of server and client
- offer如何选择该考虑哪些因素
- STM32F103 realize IAP online upgrade application
- Pointer and array are input in function to realize reverse order output
- 【ArcGIS教程】专题图制作-人口密度分布图——人口密度分析
- R descriptive statistics and hypothesis testing
- 关于01背包个人的一些理解
- 史上最全学习率调整策略lr_scheduler
猜你喜欢

Error: No named parameter with the name ‘foregroundColor‘

3GPP信道模型路损基础知识

深入解析Kubebuilder

批量归一化(标准化)处理

Pointer and array are input in function to realize reverse order output

offer如何选择该考虑哪些因素

Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str

5G VoNR+之IMS Data Channel概念

acwing 843. n-皇后问题

sublime使用技巧
随机推荐
Ansible概述和模块解释(你刚走过了今天,而扑面而来的却是昨天)
Ansible中的inventory主機清單(預祝你我有數不盡的鮮花和浪漫)
Markdown编辑器
DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)
指针与数组在函数中输入实现逆序输出
PLC Analog output analog output FB analog2nda (Mitsubishi FX3U)
Liste des hôtes d'inventaire dans ansible (je vous souhaite des fleurs et de la romance sans fin)
Ansible reports an error: "MSG": "invalid/incorrect password: permission denied, please try again“
【ArcGIS教程】专题图制作-人口密度分布图——人口密度分析
Can I specify a path in an attribute to map a property in my class to a child property in my JSON?
A detailed explanation of head pose estimation [collect good articles]
窗口可不是什么便宜的东西
leetcode 53. Maximum subarray maximum subarray sum (medium)
NiO related knowledge points (I)
谈谈讲清楚这件事的重要性
Ansible overview and module explanation (you just passed today, but yesterday came to your face)
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
Jetson nano configures pytorch deep learning environment / / to be improved
Thesis landing strategy | how to get started quickly in academic thesis writing
史上最全学习率调整策略lr_scheduler