feat(ui): icon footer button, and a button menu at the foot opens above its button

DialogIconButton is the square footer button DeleteButton already was, for
any action named by its tooltip. A "…" menu near the bottom of the window
used to be pushed up over its own button; it now opens above it.
This commit is contained in:
Maurice
2026-11-13 10:49:08 +01:00
parent 986dabf11f
commit e958a9a2bb
3 changed files with 44 additions and 11 deletions
@@ -130,6 +130,18 @@ describe('ContextMenu', () => {
expect(menu.style.overflowY).toBe('auto')
})
it('FE-W4CTX-010c: a menu hanging from a button near the foot opens above the button, not over it', () => {
layoutSize(160, 80)
const { baseElement } = render(
<ContextMenu menu={{ x: 300, y: 276, alignEnd: true, anchorTop: 240, items: [{ label: 'Open' }] }} onClose={() => {}} />
)
const menu = baseElement.querySelector('.trek-popover-enter') as HTMLElement
expect(menu.style.left).toBe('140px')
expect(menu.style.top).toBe('154px')
})
it('FE-W4CTX-011: Escape, a scroll and a resize close it', () => {
const onClose = vi.fn()
render(<ContextMenu menu={{ x: 0, y: 0, items: [{ label: 'Open' }] }} onClose={onClose} />)