TinyMCE for touch-enabled and mobile devices
The mobile experience for TinyMCE is enabled by default and has the following differences when compared to the "desktop" experience:
-
Horizontal contextual menus on mobile.
-
Side-scrolling toolbars and contextual menus on mobile.
-
Contextual keyboard options for dialogs using
inputMode
.
The mobile experience allows most of the TinyMCE plugins to work on mobile devices, except for:
TinyMCE will detect the platform and show an optimal UI experience based on the device type and screen size.
iPads do not use the mobile part of the TinyMCE init configuration. This is due to a constraint added by Apple to return the environment as a "desktop environment" for iPads. iPad users will receive the other changes to touch functionality, such as context toolbars and context menus.
|
When a TinyMCE context menu is configured, a user on a mobile device can access the TinyMCE context menu by a long press. However, when a TinyMCE context menu is not configured but a TinyMCE context toolbar is, long press will instead open the context toolbar. |
The native context menu on a mobile device can still be accessed with a TinyMCE context menu configured, either by a single tap on iOS, or by a double tap on Android. However if the contextmenu_never_use_native option is enabled, neither single nor double tap will have any effect.
|
Supported Mobile Platforms
TinyMCE mobile is tested against, and is designed to run on, the default browser running on either the current or penultimate version of either Android and iOS.
Operating System | Default browser |
---|---|
Android |
Chrome |
iOS |
Safari |
By default, both Google and Apple automatically update their operating systems and their default browsers.
Android and iOS, again by default, automatically update themselves with patches, security fixes, and minor updates. However, major updates — that is updates from one major version of the operating system to the next major version — are announced but not installed without user or system administrator input.
The default browser on each operating system is similarly updated with patches, security fixes, and minor updates. Unlike with the operating system, however, major updates — that is updates from one major version of the default browser to the next major version — are also automatically installed by default.
Consequently, Tiny Technologies, Inc. only supports TinyMCE mobile on the most recent release of each of the four supported operating system and browser combinations.
That is, TinyMCE mobile is supported on
-
the most recent release of the current version of Android in combination with the most recent release of Chrome for the current version of Android;
-
the most recent release of the penultimate version of Android in combination with the most recent release of Chrome for the penultimate version of Android.
-
the most recent release of the current version of iOS in combination with the most recent release of Safari for the current version of iOS.
-
the most recent release of the penultimate version of iOS in combination with the most recent release of Safari for the the penultimate version of iOS.
However, TinyMCE mobile is not supported on any beta or other pre-production releases of either the mobile operating system or its default browser.
Configuring mobile
Add the following meta
tag to the head
of pages using TinyMCE to ensure the mobile user interface functions as intended.
<meta name="viewport" content="width=device-width, initial-scale=1">
To set mobile specific options, add the option to the mobile
option configuration, such as:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
mobile: {
menubar: true
}
});
Mobile defaults for selected options
These mobile-specific default values have been set to disable unsupported options for mobile devices or to provide the best experience without configuration from developers.
The following options have mobile-specific default values:
-
menubar
- defaults tofalse
on mobile phones. -
toolbar_mode
- defaults toscrolling
on mobile devices. The toolbar will side-scroll by default. -
toolbar_sticky
- Sticky Toolbar is not supported on mobile devices and defaults tofalse
. -
table_grid
- Table grid is not supported on mobile devices and defaults tofalse
. When creating tables on mobile, a dialog is shown instead of the table grid. -
resize
- Resizing is not supported on mobile devices and defaults tofalse
. -
object_resizing
- Object resizing is not supported on mobile devices and defaults tofalse
.
The mobile
option
This option allows an alternative configuration to be specified that will override other options specifically for mobile devices. For information on customizing TinyMCE for mobile devices, see: TinyMCE mobile.
Type: Object
Example of mobile specific configuration
This example shows how to setup a mobile section to override some of the desktop settings with mobile specific settings.
tinymce.init({
selector: 'textarea', // change this value according to your HTML
plugins: 'code lists',
mobile: {
menubar: true,
plugins: 'autosave lists autolink',
toolbar: 'undo bold italic styles'
}
});