Focus automatically moves to the first input field when the Shepherd tooltip is displayed inside the Quasar dialog
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start with the provided Shepherd.Tour reproduction and Quasar dialog markup, then trace the tooltip and focus-handling entry points responsible for moving focus after the dialog opens. Reproduce the issue with the address inputs and verify that focus remains on the pincode input instead of moving to the first input.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- JavaScript
- Stars
- 13.8k
- Forks
- 658
- Avg merge
- 7d 5h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from shipshapecode/shepherd
-
Docs: rendering framework components as step content, and why DOM injection belongs in when.show Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
shipshapecode/shepherd#3479 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
shipshapecode/shepherd#3484 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
shipshapecode/shepherd#3478 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
shipshapecode/shepherd#3442 · 1 comment · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
shipshapecode/shepherd#3146 · 2 comments ·
All issues in shipshapecode/shepherd
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
neondatabase/website#5944 ·
-
module: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·