mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +02:00
fix(tiles): a keyboard focus brings the Tiles hover card back after a click
Found live: a click on Tiles hides the card and keeps it hidden while the pointer rests on the button, until the pointer leaves. With the pointer left there, tabbing away and back onto the button showed no card either, so a keyboard user whose mouse happened to sit on the button never got the Shift+F10 hint. Leaving the button (blur) now ends that suppression as well: a keyboard focus that comes back later is a new arrival. A click that opens the grid or a right-click that opens the menu still shows nothing, since no pointerenter or focus follows while the pointer stays. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -281,6 +281,18 @@ describe('hiding', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('a keyboard focus coming back after a click shows it, the pointer still resting there', () => {
|
||||
shown();
|
||||
btn.dispatch('click', {});
|
||||
expect(card()!.hidden).toBe(true);
|
||||
// Tab away and back, the mouse never moved.
|
||||
btn.dispatch('blur', {});
|
||||
(btn as unknown as { matches: (s: string) => boolean }).matches = (s) => s === ':focus-visible';
|
||||
btn.dispatch('focus', {});
|
||||
vi.advanceTimersByTime(300);
|
||||
expect(card()!.hidden).toBe(false);
|
||||
});
|
||||
|
||||
it('the count menu never opens beside it: openTileCountMenu hides it first', () => {
|
||||
const app = shown();
|
||||
app.openTileCountMenu({ preventDefault: vi.fn() });
|
||||
|
||||
Reference in New Issue
Block a user