[Carousel]: Navigation arrows do not respond to taps on touch devices
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
Carousel の _ontouchstart ハンドラーとテンプレートでのバインディングから始め、矢印のクリックハンドラーと関連する Carousel のテストを確認します。タッチエミュレーションでキャンセルされたタッチイベントを再現し、どちらかの矢印をタップするとナビゲーションが行われて navigate が発行されること、またマウスクリック、スワイプ、キーボード操作でのナビゲーションも引き続き機能することを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 290
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 49
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
UI5/webcomponents のほかの issue
-
[ui5-dynamic-side-content]: accessibilityAttributes role "none"/"presentation" cannot remove the landmark because aria-label is always applied対応中かも @GDamyanov が今日担当しました。 オープンbug Medium Prio TOPIC B
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
UI5/webcomponents#14244 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[TreeItemCustom]: Screen reader announces incorrect number of child tree items対応中かも @kgogov が今日担当しました。 オープンbug Medium Prio TOPIC P
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
UI5/webcomponents#14239 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[Feature Request][Side Navigation][A11Y]: Enhance user experience navigating components tree items対応中かも @TeodorTaushanov が今日担当しました。 オープンbug Medium Prio TOPIC RD
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
UI5/webcomponents#14232 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
enhancement feature request TOPIC RD
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
UI5/webcomponents#14222 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[SF][A11y][ui5-select] Conflicting ARIA: role="combobox" rendered with aria-roledescription="Listbox" (confuses screen-reader users)対応中かも @PetyaMarkovaBogdanova が 4 日前に担当しました。 オープンbug Medium Prio TOPIC P
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
UI5/webcomponents#14212 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
UI5/webcomponents の issue をすべて見る
似ている issue
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
LibreChat-AI/LibreChat#17733 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TypeStrong/typedoc#3150 ·
-
accessibility bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
Normalize image-source MIME types before SVG dispatch対応中かも @HarsH-1877 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
tscircuit/image-utils#58 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信