Skip to content

Commit c037e7d

Browse files
authored
fix: Scroll CommentBarButtons into view on selection. (#9259)
1 parent 8a578f5 commit c037e7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/keyboard_nav/line_cursor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import {BlockSvg} from '../block_svg.js';
17+
import {CommentBarButton} from '../comments/comment_bar_button.js';
1718
import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js';
1819
import {Field} from '../field.js';
1920
import {getFocusManager} from '../focus_manager.js';
@@ -403,6 +404,9 @@ export class LineCursor extends Marker {
403404
);
404405
} else if (newNode instanceof RenderedWorkspaceComment) {
405406
newNode.workspace.scrollBoundsIntoView(newNode.getBoundingRectangle());
407+
} else if (newNode instanceof CommentBarButton) {
408+
const comment = newNode.getParentComment();
409+
comment.workspace.scrollBoundsIntoView(comment.getBoundingRectangle());
406410
}
407411
}
408412

0 commit comments

Comments
 (0)