pacexy / flow

Browser-based ePub reader
https://flowoss.com
GNU Affero General Public License v3.0
2.08k stars 147 forks source link

目录栏滚动 #46

Open hzl9900 opened 1 year ago

hzl9900 commented 1 year ago

目录项太多的时候,显示不完

pacexy commented 1 year ago

目录(TOC)目前是支持滚动的,如果有问题,最好提供一下截图以及详细信息。

hzl9900 commented 1 year ago

应该是ff的问题 Firefox 图片

Edge 图片

Nsenixx commented 1 week ago

it doesn't work on IOS (scrolling), here's the solution, you need to change useDisablePinchZooming.ts like this:

import { useEffect } from 'react'

// https://github.com/excalidraw/excalidraw/blob/7eaf47c9d41a33a6230d8c3a16b5087fc720dcfb/src/packages/excalidraw/index.tsx#L66
export function useDisablePinchZooming(win?: Window) {
  useEffect(() => {
    const _win = win ?? window
    // Block pinch-zooming on iOS outside of the content area
    const handleTouchMove = (event: TouchEvent) => {
      if (event.touches.length > 1) {
        event.preventDefault()
      }
    }

    _win.document.addEventListener('touchmove', handleTouchMove, {
      passive: false,
    })

    return () => {
      _win.document.removeEventListener('touchmove', handleTouchMove)
    }
  }, [win])
}