Entering text edit mode can escape the canvas isolation
Preflight Checklist
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
When trying to increase the line height of a figure's label, I noticed my sidebar's own line height started growing unexpectedly. After poking around a bit, I figured the line height control was affecting more than just the canvas.
https://github.com/user-attachments/assets/a10bd44c-d6eb-47b9-a385-40172391d449
This suggests that the handler for line height setting isn't scoped properly. It spills out of the canvas and starts affecting random UI elements too. (I don't remember drawio granting us the authority to redecorate the UI 🙂)
To Reproduce
- Open new diagram
- Add a textbox
- Enter / doubleclick to edit text
- Click anywhere outside the canvas (this deselects the textbox selection)
- Ctrl + A to select the whole page
- From right sidebar, increase the line height
- Watch the entire UI expanding
Expected behavior
Should only change line-height of the currently selected shape's label. If there's no text selection inside canvas, do nothing
Actual behavior
Ends up modifying whatever element the user last interacted with. So something along the lines of:
document.activeElement.style.lineHeight = lineHeightInput.value;
Additional context
Text selection outside the canvas is disabled during normal editing, and the keybindings (such as Ctrl+A) are all handled and isolated inside the canvas itself. Entering text edit mode, however, seems to break this isolation and grants access to text selection anywhere on the page, so my hunch is that there is a connection between these two topics.
- draw.io version
26.2.12 - [x] I tested the problem in incognito/private mode with all browser extensions switched off.