🚸(frontend) set cursor after create comments

We have some issues with mobiles and the formatting
toolbar reopening after adding a comment, so we
restore the cursor position.
By restoring the cursor position at the head of
the selection, it will automatically close the
formatting toolbar.
This commit is contained in:
Anthony LC
2026-01-06 10:26:56 +01:00
parent 9893558c74
commit bb0502b49b
2 changed files with 14 additions and 0 deletions

View File

@@ -394,6 +394,8 @@ test.describe('Doc Comments mobile', () => {
await thread.getByRole('paragraph').first().fill('This is a comment');
await thread.locator('[data-test="save"]').click();
await expect(thread.getByText('This is a comment').first()).toBeHidden();
// Check toolbar is closed after adding a comment
await expect(page.getByRole('button', { name: 'Paragraph' })).toBeHidden();
await editor.first().click();
await editor.getByText('Hello').click();