[Carousel]: Navigation arrows do not respond to taps on touch devices
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Inizia dal gestore _ontouchstart di Carousel e dal relativo binding nel template, poi controlla il gestore dei clic delle frecce e i test correlati di Carousel. Riproduci l’evento touch annullato nell’emulazione touch e verifica che toccando una delle due frecce si avvii la navigazione e venga emesso navigate, mentre i clic del mouse, gli swipe e la navigazione da tastiera continuano a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
On touch devices the navigation arrows of ui5-carousel are rendered, but tapping them does nothing: no page change, no navigate event and no error. Swiping and keyboard navigation work, and the same arrows work when they are clicked with a mouse.
_ontouchstart cancels the touchstart event whenever its target is one of the arrows:
_ontouchstart(e) {
const target = e.target;
if (target.hasAttribute("data-ui5-arrow-forward") || target.hasAttribute("data-ui5-arrow-back")) {
e.preventDefault();
}
}
The template binds this handler (onTouchStart) as a non-passive listener, so the cancellation takes effect. A cancelled touchstart keeps the browser from dispatching the compatibility mouse events and the click, so _navButtonClick is never reached. For mouse input, _onmousedown cancels mousedown in the same way; that only prevents the focus change and still lets the click through.
Affected Component
Carousel
Expected Behaviour
Tapping the forward or back arrow on a touch device navigates to the next or previous page, just as clicking it with a mouse does.
Isolated Example
<ui5-carousel arrows-placement="Navigation">
<div>Page 1</div>
<div>Page 2</div>
<div>Page 3</div>
</ui5-carousel>
The default arrows-placement="Content" is affected as well, because the content arrows are always visible on touch devices (see #10383).
Steps to Reproduce
- Render the carousel above.
- Open the page on a touch device, or in Chrome DevTools device mode with touch emulation, and reload it there.
- Tap the forward arrow.
- Nothing happens. Swiping changes the page, and on a desktop without touch emulation a mouse click on the arrow works.
Console check in the touch-emulated page:
const carousel = document.querySelector("ui5-carousel");
const arrow = carousel.shadowRoot.querySelector("[data-ui5-arrow-forward]");
const touch = new Touch({ identifier: 1, target: arrow, clientX: 0, clientY: 0 });
const event = new TouchEvent("touchstart", { bubbles: true, cancelable: true, composed: true, touches: [touch], changedTouches: [touch] });
arrow.dispatchEvent(event);
event.defaultPrevented; // true
arrow.click(); // navigates, so the click handler itself works
Log Output, Stack Trace or Screenshots
No errors are logged.
Priority
Medium
UI5 Web Components Version
2.27.2 (the same _ontouchstart code is still in 2.28.1)
Browser
Chrome
Operating System
macOS, Chrome DevTools device emulation with touch
Additional Context
Possible fix: cancel only mousedown (to keep the focus where it is) but not touchstart, or handle the tap on touchend.
Current workaround: set hide-navigation-arrows when no fine pointer is available (matchMedia("(any-pointer: fine)")) and rely on swiping on touch devices.
Declaration
- I’m not disclosing any internal or sensitive information.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 290
- Merge medio
- 2g 16h
- PR unite (30g)
- 49
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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 UI5/webcomponents
-
[ui5-dynamic-side-content]: accessibilityAttributes role "none"/"presentation" cannot remove the landmark because aria-label is always appliedForse già presa @GDamyanov l’ha presa oggi. Apertabug Medium Prio TOPIC B
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
UI5/webcomponents#14244 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[TreeItemCustom]: Screen reader announces incorrect number of child tree itemsForse già presa @kgogov l’ha presa oggi. Apertabug Medium Prio TOPIC P
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
UI5/webcomponents#14239 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[Feature Request][Side Navigation][A11Y]: Enhance user experience navigating components tree itemsForse già presa @TeodorTaushanov l’ha presa oggi. Apertabug Medium Prio TOPIC RD
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
UI5/webcomponents#14232 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement feature request TOPIC RD
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
UI5/webcomponents#14222 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[SF][A11y][ui5-select] Conflicting ARIA: role="combobox" rendered with aria-roledescription="Listbox" (confuses screen-reader users)Forse già presa @PetyaMarkovaBogdanova l’ha presa 4 giorni fa. Apertabug Medium Prio TOPIC P
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
UI5/webcomponents#14212 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di UI5/webcomponents
Issue simili
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/playwright#43875 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
calagopus/panel#285 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 88/100
adobe/react-spectrum#10909 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Run the dependency drift checkForse già presa @spaceninja l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
cloudfour/lighthouse-parade#449 ·
I maintainer di solito rispondono entro 1 giorno