flutter_math icon indicating copy to clipboard operation
flutter_math copied to clipboard

SelectableMath's selection toolbar won't appear in mobile browsers in most cases

Open znjameswu opened this issue 3 years ago • 1 comments

Currently SelectableMath employed a hack to get righ-click context menu on desktop web, as discussed in https://github.com/znjameswu/flutter_math/issues/10#issuecomment-714297030. However this has an unexpected side effect, because it breaks mobile browsers's selection toolbar.

On mobile web, the position of selection toolbar depends on the actual position of the underlying textarea (doesn't matter if Flutter Web clips it or not). If we make the textarea riduculously large, then the selection toolbar will fly outside the viewport in most cases.

znjameswu avatar Oct 26 '20 22:10 znjameswu

I think it's better to drop the idea of using "native" context menu on web. MathQuill failed achieve it either. In fact, no web implementations did this with a native context menu. They all intercept the right click event and override with their custom context menu. Current Flutter can't do that easily.

Also, desktop web can still copy by ctrl+C in the future.

Once https://github.com/flutter/flutter/issues/31955 is resolved, native context menu on web will be dropped and replaced with a custom one. Currently they are still useful for web demos.

znjameswu avatar Oct 30 '20 01:10 znjameswu