Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Touch scroll not possible on highlighted area

オープン
#1,717 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend

調査の方向性

src/js/components/shepherd-modal.svelte の参照されている touchmove ハンドラーから始め、小さなモバイル viewport で shepherdjs.dev 上の問題を再現します。ハイライトされた領域とモーダルが、マウスによるスクロールと比較して touchmove をどのように処理するかを追跡し、報告されているタッチスクロールの動作が修正されるか設定可能になり、グレー表示された領域のスクロールを壊さないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

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:

  1. Open shepherdjs.dev on small mobile device or with dev-tools
  2. Click through the first two steps till you reach the 02. Example section
  3. Try to touch scroll on the code snippet on the example (should not work)
  4. Try to touch scroll on the 01. How to include code snippet (should work)
  5. 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.

主要言語
JavaScript
スター
13.8k
フォーク
658
平均マージ
7日 5時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

shipshapecode/shepherd のほかの issue

shipshapecode/shepherd の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。