flow icon indicating copy to clipboard operation
flow copied to clipboard

目录栏滚动

Open hzl9900 opened this issue 2 years ago • 3 comments

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

hzl9900 avatar Nov 10 '22 13:11 hzl9900

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

pacexy avatar Nov 11 '22 00:11 pacexy

应该是ff的问题 Firefox 图片

Edge 图片

hzl9900 avatar Nov 11 '22 05:11 hzl9900

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])
}

Nsenixx avatar Sep 25 '24 15:09 Nsenixx