Pixi.js: autoPreventDefaultが機能していません。 まだスクロールに触れることはできません。

作成日 2018年04月02日  ·  4コメント  ·  ソース: pixijs/pixi.js

こんにちは、まず第一に、素晴らしい図書館に感謝します。
Pixiは素晴らしいです、v5が出るのが待ちきれません!
今、私は問題に遭遇しました。
モバイルスクロールを使用してキャンバスをスクロールできません。
^ 4.7.1バージョンを使用しています

これが私のコードです

    this.App = new Application(
      Math.min(window.innerWidth, window.screen.width),
      Math.min(window.innerHeight, window.screen.height),
      {
        backgroundColor: `0x${backgroundColor}`,
        resolution: window.devicePixelRatio
      }
    );

    this.App.renderer.plugins.interaction.autoPreventDefault = false; // notice that after adding this line still can't have scroll work.
    this.App.renderer.autoResize = true;

最も参考になるコメント

    this.App.renderer.plugins.interaction.autoPreventDefault = false;
    this.App.renderer.view.style.touchAction = 'auto';

全てのコメント4件

    this.App.renderer.plugins.interaction.autoPreventDefault = false;
    this.App.renderer.view.style.touchAction = 'auto';

@rockmandash renderer.view.style.touchAction = 'auto';は私のためにトリックをしました!

これはどこかに文書化されていますか?! pixiがこのcssルール( touch-action )をcanvas要素自体に設定しているように見えますか?

このスレッドは、閉じられた後、最近のアクティビティがないため、自動的にロックされています。 関連するバグについては、新しい問題を開いてください。

このページは役に立ちましたか?
0 / 5 - 0 評価