fix(手机): 收起键盘后「提交」按钮不回来;比赛领奖台第一名被挤出屏幕;iPhone 点输入框整页放大
- 题目页:安卓按返回键收键盘时编辑器不失焦,符号键一直贴底、「运行例子 / 提交」不回来。 改成看键盘真弹着没有(可视视口变矮),不只看焦点 - 比赛排名:结束后的领奖台三块共 646px,手机上第一名被切掉、第三名看不见;改成平分一行 - iPhone:点 14/15px 的输入框和代码编辑器,Safari 会整页放大且不缩回;只给 iOS 加 maximum-scale=1 - 登录:手机上选完班不再自动聚焦搜索框(键盘弹出来盖住半张名单) - 题单:窄屏上题目拆成两张没标题的卡片,像分了两组;放不下两栏时合成一张 - 「中等」在题目页是蓝色、在题目列表是橙色,统一成橙色 - 零碎:自学四列表格在 360 宽上收窄格子;统计「错得最多的题」表头不再挤成竖排; 「第 N 名」「14 道」不再把最后一个字甩到下一行 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
90ce1ab0f5
commit
a5d5c39411
12 files changed
+177
-28
No files matched your search
@@ -123,7 +123,7 @@ watch(klass, (value) => {
|
||||
clearError()
|
||||
if (value) {
|
||||
loadNames(value)
|
||||
focusLater(() => searchRef.value)
|
||||
focusSearch()
|
||||
} else names.value = []
|
||||
})
|
||||
|
||||
@@ -137,6 +137,15 @@ function focusLater(target: () => { focus: () => void } | null | undefined) {
|
||||
nextTick(() => target()?.focus())
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机上不替学生点搜索框:一聚焦键盘就弹出来,把下面的名单盖掉一半,
|
||||
* 而手机上本来就是直接点名字更快。电脑上照旧聚焦,进来就能打拼音缩写。
|
||||
*/
|
||||
const touchScreen = useMediaQuery("(pointer: coarse)")
|
||||
function focusSearch() {
|
||||
if (!touchScreen.value) focusLater(() => searchRef.value)
|
||||
}
|
||||
|
||||
function pick(name: string) {
|
||||
picked.value = name
|
||||
password.value = ""
|
||||
@@ -148,7 +157,7 @@ function unpick() {
|
||||
picked.value = null
|
||||
password.value = ""
|
||||
clearError()
|
||||
focusLater(() => searchRef.value)
|
||||
focusSearch()
|
||||
}
|
||||
|
||||
/** 搜到只剩一个人,回车就是点他 */
|
||||
@@ -163,7 +172,8 @@ function switchMode(next: Mode) {
|
||||
password.value = ""
|
||||
query.value = ""
|
||||
clearError()
|
||||
focusLater(() => (next === "user" ? usernameRef.value : searchRef.value))
|
||||
if (next === "user") focusLater(() => usernameRef.value)
|
||||
else focusSearch()
|
||||
}
|
||||
|
||||
function goSignup() {
|
||||
@@ -249,7 +259,8 @@ watch(
|
||||
query.value = ""
|
||||
clearError()
|
||||
restoreLast()
|
||||
focusLater(() => (mode.value === "user" ? usernameRef.value : searchRef.value))
|
||||
if (mode.value === "user") focusLater(() => usernameRef.value)
|
||||
else focusSearch()
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user