mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
fix(editor): should shift toolbar to keep in view when selected area exceeds view (#10642)
Closes: [BS-2757](https://linear.app/affine-design/issue/BS-2757/体验优化:pageedgeless-下,有超长选区时,toolbar-flip-后浮动在下方)   
This commit is contained in:
@@ -123,7 +123,7 @@ test('should format quick bar show when select text by keyboard', async ({
|
||||
throw new Error("formatBar doesn't exist");
|
||||
}
|
||||
let selectionRect = await getSelectionRect(page);
|
||||
assertAlmostEqual(formatBarBox.x - selectionRect.x, -107, 3);
|
||||
assertAlmostEqual(formatBarBox.x - selectionRect.x, -103, 3);
|
||||
assertAlmostEqual(
|
||||
formatBarBox.y + formatBarBox.height - selectionRect.top,
|
||||
-10,
|
||||
@@ -150,7 +150,7 @@ test('should format quick bar show when select text by keyboard', async ({
|
||||
// The x position of the format quick bar depends on the font size
|
||||
// so there are slight differences in different environments
|
||||
selectionRect = await getSelectionRect(page);
|
||||
assertAlmostEqual(formatBarBox.x - selectionRect.x, -107, 3);
|
||||
assertAlmostEqual(formatBarBox.x - selectionRect.x, -103, 3);
|
||||
assertAlmostEqual(
|
||||
formatBarBox.y + formatBarBox.height - selectionRect.top,
|
||||
-10,
|
||||
|
||||
Reference in New Issue
Block a user