@samitouri / QOSami-HFS / commits / 2b876bba

fix: bad file menu position on mobile-landscape

Massimo Melina committed Jun 16, 2023 at 12:48 UTC 2b876bba6b0b7d13c895963f3471580ff4c2010d
1 file changed +3 -3
frontend/src/fileMenu.ts
+3 -3
@@ -1,5 +1,5 @@
1 import { t, useI18N } from './i18n'
2 -import { dontBotherWithKeys, formatBytes, hfsEvent, hIcon, isMobile, newDialog } from './misc'
2 +import { dontBotherWithKeys, formatBytes, hfsEvent, hIcon, newDialog } from './misc'
3 import { createElement as h, Fragment, isValidElement, MouseEventHandler, ReactNode } from 'react'
4 import _ from 'lodash'
5 import { getEntryIcon, MISSING_PERM } from './BrowseFiles'
@@ -33,8 +33,8 @@ export function openFileMenu(entry: DirEntry, ev: MouseEvent, addToMenu: FileMen
33 title: isFolder ? t`Folder menu` : t`File menu`,
34 className: 'file-dialog',
35 icon: () => ico,
36 - position: isMobile() ? undefined
37 - : [ev.pageX, ev.pageY - window.scrollY] as [number, number],
36 + position: Math.min(innerWidth, innerHeight) < 800 ? undefined
37 + : [ev.pageX, ev.pageY - scrollY] as [number, number],
38 Content() {
39 const {t} = useI18N()
40 return h(Fragment, {},