Adaptivity
- 2 minutes to read
The DevExpress HTML Editor Rich Edit provides the following features that you can use to adapt the control to a mobile browser’s window:
Full-Screen Mode
The ASPxHTMLEditor’s full-screen mode extends the control to the browser’s client area that frees extra space for the editor’s zone within a mobile device’s window.
End-users can activate full-screen mode by clicking the Full Screen ribbon button (or by pressing F11 for desktop) when the control has focus. You can switch the HTML Editor to the full-screen mode by executing the ASPxClientCommandConsts.FULLSCREEN_COMMAND client command on the control’s Init event.
Important
We recommend adding the following meta tag to the HTML document’s head section to stabilize displaying HTMLEditor in the full-screen mode on mobile devices:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
This tag defines a viewport’s settings for mobile browsers. Some web pages do not fit a mobile browser’s window, so it scales pages down to display them entirely within the viewport and enables end-users to scale up them. When HTML Editor is switched to the full-screen mode on mobile devices, it occupies the area that should be visible within the viewport’s default scale. If a page contains additional content that increases the page’s width and can be scaled down, the HTML Editor control in full-screen mode does not occupy the scaled viewport’s zone entirely.
The meta tag above stretches the page’s content to the viewport’s width and disables automatic and custom scaling to prevent the described issue.
Online Demo
Adaptive Toolbar
The ASPxHtmlEditor‘s Menu toolbar includes an adaptive mode. In this mode, the toolbar automatically moves items one by one to the ellipse button’s popup menu when the control’s size does not fit the browser window. You can enable the adaptive mode by setting the HtmlEditorAdaptivitySettings.Enabled to true.
You can define the order in which the toolbar’s items are hidden by specifying the corresponding item’s HtmlEditorToolbarItem.AdaptivePriority property.
Adaptive Dialogs
Each HTML Editor’s built-in dialog is adaptive: it adjusts content to fit the mobile browser window: