Keep text selection visible when clicking toolbar buttons. Select text and click the toolbar β your selection stays highlighted.Documentation Index
Fetch the complete documentation index at: https://superdoc-nick-sd-2070-add-content-controls-namespace-to-doc.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Use case
- Professional UX - Selection doesnβt disappear when using toolbars
- Multi-format editing - Apply multiple formats without reselecting
- User expectations - Matches desktop word processor behavior
Integration
Addtoolbar-button class to toolbar elements. Call restorePreservedSelection() before applying commands.
Commands
restorePreservedSelection
Restore the preserved selection
Used internally to maintain selection when interacting with toolbar
Function Command function

