Touch scroll not possible on highlighted area
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia in src/js/components/shepherd-modal.svelte, nei gestori touchmove indicati, e riproduci il problema su shepherdjs.dev con un viewport mobile di piccole dimensioni. Traccia il modo in cui l'area evidenziata e il modal gestiscono touchmove rispetto allo scorrimento con il mouse, quindi verifica che il comportamento di scorrimento tramite tocco segnalato venga corretto o reso configurabile senza compromettere lo scorrimento nell'area oscurata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It is not possible to scroll with touch on the highlighted area or on the modal. However touch scroll on the grayed area and mouse scroll is possible.
Reproduce
This can be tested on shepherdjs.dev:
- Open shepherdjs.dev on small mobile device or with dev-tools
- Click through the first two steps till you reach the
02. Examplesection - Try to touch scroll on the code snippet on the example (should not work)
- Try to touch scroll on the
01. How to includecode snippet (should work) - Try to scroll with mouse wheel (should work)
The default behavior of the touchmove event has been disabled here: https://github.com/shipshapecode/shepherd/blob/99d4f995f79d6bf99ea55c2bd0c62f309f2de968/src/js/components/shepherd-modal.svelte#L90-L92
https://github.com/shipshapecode/shepherd/blob/99d4f995f79d6bf99ea55c2bd0c62f309f2de968/src/js/components/shepherd-modal.svelte#L98-L107
Workaround
I'm currently using this workaround to avoid the call of preventDefault
const allowTouchmove = (event) => {
event.stopPropagation()
}
const tour = new Shepherd.Tour({
defaultStepOptions: {
when: {
show () {
const target = this.getTarget()
if (target) {
target.addEventListener('touchmove', allowTouchmove)
}
},
hide () {
const target = this.getTarget()
if (target) {
target.removeEventListener('touchmove', allowTouchmove)
}
}
}
}
})
Suggestion
IMO the preventDefault of the touchmove event should be at least avoidable through the step configuration (something like allowTouchScroll: true).
Also the behavior between mouse scroll, touch scroll on grayed area and touch scroll on highlighted area feels inconsistent and not understandable for a user.
- 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 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
shipshapecode/shepherd#3505 ·
-
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 ·
Tutte le issue di shipshapecode/shepherd
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100