From 4803ad1c43d1faf1c0e2e2dd4024c29af523d243 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Mon, 15 Jan 2018 14:36:09 +0200 Subject: [PATCH] Add IE11 opt-out of rich text pasting, and documentation notes --- client/src/components/Draftail/index.js | 5 ++++- client/src/config/wagtailConfig.js | 2 ++ docs/contributing/developing.rst | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/components/Draftail/index.js b/client/src/components/Draftail/index.js index bd04d5c191..7b86eafc82 100644 --- a/client/src/components/Draftail/index.js +++ b/client/src/components/Draftail/index.js @@ -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} diff --git a/client/src/config/wagtailConfig.js b/client/src/config/wagtailConfig.js index 9dada3baab..e0b2849550 100644 --- a/client/src/config/wagtailConfig.js +++ b/client/src/config/wagtailConfig.js @@ -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; diff --git a/docs/contributing/developing.rst b/docs/contributing/developing.rst index 51dc1a0859..2d50e7108e 100644 --- a/docs/contributing/developing.rst +++ b/docs/contributing/developing.rst @@ -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 `_. +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: ============= ============= =============