Focus automatically moves to the first input field when the Shepherd tooltip is displayed inside the Quasar dialog
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia con la riproduzione fornita di Shepherd.Tour e il markup del dialogo Quasar, quindi traccia i punti di ingresso del tooltip e della gestione del focus responsabili dello spostamento del focus dopo l’apertura del dialogo. Riproduci il problema con i campi dell’indirizzo e verifica che il focus rimanga sul campo di input pincode invece di spostarsi sul primo campo di input.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- JavaScript
- Stelle
- 13.8k
- Fork
- 658
- Merge medio
- 7g 5h
- PR unite (30g)
- 18
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di shipshapecode/shepherd
-
Docs: rendering framework components as step content, and why DOM injection belongs in when.show Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
shipshapecode/shepherd#3479 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3484 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3478 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
shipshapecode/shepherd#3442 · 1 commento · 2 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
shipshapecode/shepherd#3146 · 2 commenti ·
Tutte le issue di shipshapecode/shepherd
Issue simili
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Improve Title Support Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·