Focus automatically moves to the first input field when the Shepherd tooltip is displayed inside the Quasar dialog
まだ誰も着手していません。
評価
- 難易度
- 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
- フォーク
- 658
- 平均マージ
- 7日 5時間
- マージ済み PR(30日)
- 18
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
shipshapecode/shepherd#3484 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
shipshapecode/shepherd#3478 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
shipshapecode/shepherd#3442 · コメント 1 件 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
shipshapecode/shepherd#3146 · コメント 2 件 ·
shipshapecode/shepherd の issue をすべて見る
似ている issue
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/safe-publish#594 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100