Open only the info popover when a calendar bar is tapped
On touch screens a tap on a task bar both showed its info popover and opened the schedule dialog. A tap now only opens the popover, which stays open until something else is tapped, and the popover's own "Open schedule" button opens the dialog. Mouse clicks and Enter still open the dialog directly. The popover is no longer a tooltip since it holds a button, and the bar's aria-describedby points only at the details. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -97,6 +97,30 @@ it('shows the job details of a bar on hover and focus, and closes them with Esca
|
||||
->assertNoJavaScriptErrors();
|
||||
})->with(['light', 'dark']);
|
||||
|
||||
it('opens only the popover on a tap, and the dialog from its button', function () {
|
||||
$key = $this->task->id.'-'.$this->user->id;
|
||||
$open = "document.getElementById('bar-info-{$key}').matches(':popover-open')";
|
||||
$tap = <<<JS
|
||||
(() => {
|
||||
const bar = document.getElementById('bar-{$key}');
|
||||
const options = { bubbles: true, pointerType: 'touch', isPrimary: true, button: 0 };
|
||||
bar.dispatchEvent(new PointerEvent('pointerdown', options));
|
||||
bar.dispatchEvent(new PointerEvent('pointerup', options));
|
||||
bar.dispatchEvent(new MouseEvent('mouseenter'));
|
||||
bar.click();
|
||||
})()
|
||||
JS;
|
||||
|
||||
$visit = visit(route('jobs.calendar'))->on()->desktop();
|
||||
$visit->script($tap);
|
||||
$visit->assertScript($open, true)
|
||||
->assertScript("document.getElementById('task-schedule-dialog').open", false)
|
||||
->click('#bar-info-'.$key.'-open')
|
||||
->assertSee('Tehtävän aikataulu')
|
||||
->assertScript("document.getElementById('task-schedule-dialog').open", true)
|
||||
->assertScript($open, false);
|
||||
});
|
||||
|
||||
it('moves a task to another person by dragging its bar', function () {
|
||||
// The bar (today – today + 2) is grabbed at its middle day, so dropping it
|
||||
// on today + 4 moves it three days later.
|
||||
|
||||
Reference in New Issue
Block a user