Focus automatically moves to the first input field when the Shepherd tooltip is displayed inside the Quasar dialog
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- frontend
调研方向
从提供的 Shepherd.Tour 复现和 Quasar 对话框标记开始,然后跟踪负责在对话框打开后移动焦点的 tooltip 和焦点处理入口点。使用地址输入框复现该问题,并确认焦点仍停留在 pincode 输入框上,而不是移动到第一个输入框。
由索引模型根据 Issue 内容生成。
描述
https://github.com/user-attachments/assets/277c233b-3522-4d75-8481-42fa2b48115f
const tour = new Shepherd.Tour({
defaultStepOptions: {
scrollTo: false,
showCancelLink: true
}
});
tour.addStep({
id: 'test-button',
text: 'Click this button to open the address dialog.',
attachTo: {
element: '[data-cy="test-button"]',
on: 'bottom'
},
buttons: [
{
text: 'Skip',
action: () => tour.cancel(),
classes: 'shepherd-button-skip'
},
{
text: 'Next',
action: () => {
document
.querySelector('[data-cy="test-button"]')
?.click();
setTimeout(() => {
tour.next();
}, 200);
}
}
]
});
tour.addStep({
id: 'address-input',
text: 'Enter your address here.',
attachTo: {
element: '[data-cy="address-input"]',
on: 'bottom'
},
beforeShowPromise: () => {
return new Promise((resolve) => {
const checkInput = setInterval(() => {
const input = document.querySelector(
'[data-cy="address-input"]'
);
if (input) {
clearInterval(checkInput);
resolve();
}
}, 100);
});
},
buttons: [
{
text: 'Back',
action: () => tour.back()
},
{
text: 'Next',
action: () => tour.next()
}
]
});
tour.addStep({
id: 'address2-input',
text: 'Enter your address222 here.',
attachTo: {
element: '[data-cy="address2-input"]',
on: 'bottom'
},
beforeShowPromise: () => {
return new Promise((resolve) => {
const checkInput = setInterval(() => {
const input = document.querySelector(
'[data-cy="address2-input"]'
);
if (input) {
clearInterval(checkInput);
resolve();
}
}, 100);
});
},
buttons: [
{
text: 'Back',
action: () => tour.back()
},
{
text: 'Next',
action: () => tour.next()
}
]
});
tour.addStep({
id: 'pincode-input',
text: 'Enter your pincode here.',
attachTo: { element: '[data-cy="pincode-input"]', on: 'bottom' },
beforeShowPromise: () => {
return new Promise((resolve) => {
const checkInput = setInterval(() => {
const input = document.querySelector('[data-cy="pincode-input"]');
if (input) {
input.focus();
clearInterval(checkInput);
resolve();
}
}, 100);
});
},
buttons: [
{
text: 'Back',
action: () => tour.back()
},
{
text: 'Next',
action: () => tour.next()
}
]
});
Quasar dialog code:
<q-dialog v-model="prompt" no-focus
persistent>
<q-card data-cy="address-dialog"
style="min-width: 350px">
<q-card-section>
<div class="text-h6">Your address</div>
</q-card-section>
<q-card-section class="q-pt-none">
<q-input data-cy="address-input"
dense
v-model="address" />
<q-input data-cy="address2-input"
dense
v-model="address2" />
<q-input data-cy="pincode-input"
dense
v-model="pincode" />
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn data-cy="address-cancel"
flat
label="Cancel"
v-close-popup />
<q-btn data-cy="address-add"
flat
label="Add address"
v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
The Pincode input is initially focused when the Shepherd tooltip is displayed, but the focus is then automatically moved to the first input field.
- 主要语言
- JavaScript
- 星标
- 13.8k
- 派生
- 656
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
shipshapecode/shepherd 的其他 Issue
-
Docs: rendering framework components as step content, and why DOM injection belongs in when.show未关闭documentation
难度 2/5 1-3 小时 新手友好度 84/100
shipshapecode/shepherd#3479 ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
shipshapecode/shepherd#3555 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
shipshapecode/shepherd#3442 · 1 条评论 · 2 个 reaction ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
shipshapecode/shepherd#3146 · 2 条评论 ·
维护者通常 3 天内回复
-
question
难度 2/5 1-3 小时 新手友好度 38/100
shipshapecode/shepherd#3121 · 4 条评论 ·
维护者通常 3 天内回复
查看 shipshapecode/shepherd 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
factory-active factory-automatic harness/claude-code task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 1/5 1-3 小时 新手友好度 85/100
zmo2s/agent-toolbox#23 ·