Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web端: EditBox组件与画面宽高比例不一致时,输入框被挤出屏幕,导致画布偏移 #18178

Open
PremiumWater2025 opened this issue Jan 13, 2025 · 2 comments
Assignees
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@PremiumWater2025
Copy link

PremiumWater2025 commented Jan 13, 2025

Cocos Creator version

3.8.3

System information

MacOS Sequoia 15.2, Chrome 131.0.6778.265

Issue description

如果项目设计分辨率是竖屏,仅勾选了适配屏幕高度。

image

游戏运行在 Web 端时,聚焦 EditBox 会导致输入框出现偏移,将画面挤出到画布之外

image

image

Relevant error log output

No response

Steps to reproduce

  1. 新建一个 Empty 2D 空项目

  2. 项目设计分辨率:1125, 2436。仅勾选适配屏幕高度。

  3. 在 Canvas 节点下,新建一个 EditBox 对象

  4. 在浏览器预览,使用网页全屏模式.

  5. 在游戏中点击 EditBox 聚焦输入框。

  6. 观察现象:光标偏移到了画布右侧,在输入任意字符输入法也同样在屏幕外,整个游戏画布也会出现偏移,并随着输入光标而进一步影响偏移位置。

Minimal reproduction project

No response

@PremiumWater2025 PremiumWater2025 added Bug Needs Triage Needs to be assigned by the team labels Jan 13, 2025
@PremiumWater2025 PremiumWater2025 changed the title Web端: EditBox组件在仅勾选 "适配屏幕高度" 模式时,输入框被挤出屏幕,导致画布偏移 Web端: EditBox组件如果存在 Widget 组件,在仅勾选 "适配屏幕高度" 模式时,输入框被挤出屏幕,导致画布偏移 Jan 13, 2025
@PremiumWater2025 PremiumWater2025 changed the title Web端: EditBox组件如果存在 Widget 组件,在仅勾选 "适配屏幕高度" 模式时,输入框被挤出屏幕,导致画布偏移 Web端: EditBox组件在仅勾选 "适配屏幕高度" 模式时,输入框被挤出屏幕,导致画布偏移 Jan 14, 2025
@PremiumWater2025
Copy link
Author

PremiumWater2025 commented Jan 14, 2025

看起来和这个问题是相同的 #12299

@PremiumWater2025 PremiumWater2025 changed the title Web端: EditBox组件在仅勾选 "适配屏幕高度" 模式时,输入框被挤出屏幕,导致画布偏移 Web端: EditBox组件与画面宽高比例不一致时,输入框被挤出屏幕,导致画布偏移 Jan 14, 2025
@PremiumWater2025
Copy link
Author

是否能提供一个方法,手动更新 EditBox 位置和尺寸跟 Canvas 进行同步?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants