hookehuyr

fix 弹出框键盘高度调整

......@@ -44,13 +44,17 @@ const show = ref(false);
const openKeyboard = (e) => {
show.value = true;
// 键盘上移动
const height =
const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
let scroll_height = "";
if (target_to_view_height < 244) {
scroll_height =
window.innerHeight -
e.target.getBoundingClientRect().y -
e.target.getBoundingClientRect().height +
50;
document.body.style.paddingBottom = height + "px";
document.documentElement.scrollTop = height;
244;
document.body.style.paddingBottom = scroll_height + "px";
document.documentElement.scrollTop = scroll_height;
}
};
const blurKeyboard = () => {
show.value = false;
......
......@@ -56,13 +56,17 @@ const showKeyboard = (e) => {
showInteger.value = true;
}
// 键盘上移动
const height =
const target_to_view_height = window.innerHeight - e.target.getBoundingClientRect().y; // 元素到适口高度
let scroll_height = "";
if (target_to_view_height < 244) {
scroll_height =
window.innerHeight -
e.target.getBoundingClientRect().y +
e.target.getBoundingClientRect().y -
e.target.getBoundingClientRect().height +
244;
document.body.style.paddingBottom = height + "px";
document.documentElement.scrollTop = height;
document.body.style.paddingBottom = scroll_height + "px";
document.documentElement.scrollTop = scroll_height;
}
};
const blurKeyboard = () => {
if (props.item.component_props.type === "decimal") {
......