FR: Automatically adjust viewport to keep the active text element and all its content visible while typing
Is your feature request related to a problem? Please describe.
Currently, when typing near a screen edge in Excalidraw, the canvas remains static. To keep the cursor visible at the very edge, the software pushes the beginning of the text out of the visible bounds of the text element:
- Horizontally: As typing reaches the right edge, the beginning part of the line gets pushed leftwards beyond the text element's visible area to keep the end of the line in view
- Vertically: Even when using "T" to create fixed-width text elements, if the text element is near the bottom edge and grows long enough, the beginning lines are pushed upward beyond the element's height to keep the current last line in view
This forces the user to stop their creative flow, manually drag the canvas to a more visible area to reposition the drawing before they can see what they've already written and continue typing.
Describe the solution you'd like
I would like Excalidraw to implement a dynamic viewport adjustment similar to Obsidian Canvas cards. In Canvas, the screen adjusts horizontally (until reaching max card width) and vertically as the user types, ensuring that the entire card and all its text remain visible within the viewport at all times.
The canvas should automatically pan in the direction of the typing/growth to maintain a "safe margin" between the text input box and the screen edges.
Real-life usage scenarios
- Text input in general.
- High-Zoom Annotating: When zoomed in (e.g., 200%+) to add detail to a complex map, the limited screen space makes it very easy to "run off" the edge. Auto-panning would allow for continuous detailed writing without manual canvas adjustments.
- Mobile/Tablet Brainstorming: On mobile devices, the on-screen keyboard significantly reduces the visible area. If the text box is positioned where the keyboard pops up, or near the remaining top/side edges, the user often loses sight of the beginning of their thought as they type
Describe alternatives you've considered
- Manual Panning: manual intervention that breaks flow
- Fixed Widths: Using the "T" tool to set a width helps with wrapping but doesn't prevent the entire container from being partially off-screen
Additional context
https://github.com/user-attachments/assets/e6261241-6a21-4a06-ab4b-bf7a8049d5cb
Source: zsviczian/obsidian-excalidraw-plugin