Add IE11 opt-out of rich text pasting, and documentation notes

pull/4136/head
Thibaud Colas 2018-01-15 14:36:09 +02:00
rodzic 9c5c116b04
commit 4803ad1c43
3 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -2,6 +2,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { DraftailEditor } from 'draftail';
import { IS_IE11 } from '../../config/wagtailConfig';
import Icon from '../Icon/Icon';
import sources from './sources';
@ -68,7 +70,8 @@ export const initEditor = (fieldName, options = {}) => {
spellCheck={true}
// If increasing above 4, we will need to add styles for the extra nesting levels.
maxListNesting={4}
stripPastedStyles={false}
// Draft.js + IE 11 presents some issues with pasting rich text. Disable rich paste there.
stripPastedStyles={IS_IE11}
{...options}
blockTypes={blockTypes}
inlineStyles={inlineStyles}

Wyświetl plik

@ -4,3 +4,5 @@ export const ADMIN_URLS = global.wagtailConfig.ADMIN_URLS;
// Maximum number of pages to load inside the explorer menu.
export const MAX_EXPLORER_PAGES = 200;
export const IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;

Wyświetl plik

@ -153,6 +153,11 @@ Safari macOS Last 2
We aim for Wagtail to work in those environments. Our development standards ensure that the site is usable on other browsers **and will work on future browsers**. To test on IE, install virtual machines `made available by Microsoft <https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/>`_.
IE 11 is gradually falling out of use, and specific features are unsupported in this browser:
* Rich text copy-paste in the rich text editor.
* Sticky toolbar in the rich text editor.
Unsupported browsers / devices include:
============= ============= =============