Scroll only the body of work dialogs, so there is one scrollbar

The native dialog scrolled too once its content outgrew the browser's
default max-height. It now clips to the viewport and only the body scrolls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-30 11:13:38 +02:00
co-authored by Claude Opus 5.5
parent f3d2b3e39e
commit e274a8d2b1
2 changed files with 21 additions and 3 deletions
+17
View File
@@ -176,6 +176,23 @@ it('has no accessibility issues in the job editor and the quick intake dialog',
'mobile, dark' => ['mobile', 'dark'],
]);
it('scrolls only the body of the job editor when a task has many comments', function () {
$task = TaskModel::factory()->create(['customer_job_id' => $this->job->id, 'title' => 'Kuvauspäivä']);
foreach (range(1, 15) as $number) {
TaskCommentModel::query()->create(['task_id' => $task->id, 'user_id' => $this->user->id, 'body' => 'Kommentti numero '.$number.' kuvauspäivän järjestelyistä.']);
}
visit(route('jobs.board'))
->on()->desktop()
->click('#card-job-'.$this->job->id.'-open')
->click('#job-editor-dialog [aria-controls^="editor-extras-"]')
->assertSee('Kommentti numero 15')
->assertScript('getComputedStyle(document.getElementById("job-editor-dialog")).overflowY', 'hidden')
->assertScript('(() => { const d = document.getElementById("job-editor-dialog"); return d.scrollHeight <= d.clientHeight + 1; })()', true)
->assertNoAccessibilityIssues(level: 2);
});
it('marks a task done from the task panel of a card', function () {
$this->job->update(['status' => 'in_production']);
$task = TaskModel::factory()->create(['customer_job_id' => $this->job->id, 'title' => 'Leikkaus', 'status' => 'in_progress']);