Skip to content

Commit

Permalink
Fix #1326 Safari can't focus with draggable parent
Browse files Browse the repository at this point in the history
Summary:
**Summary**

DraftEditors that lived inside draggable parents were useless in Safari. Now they work.
Solution found here: react-dnd/react-dnd#178 (comment)

**Test Plan**

Use the fiddle in #1326 with the updated version.
For a quick n dirty, just add this to the stylesheet:
`div[contenteditable="true"] { user-select: text;}`
Closes facebookarchive/draft-js#1356

Differential Revision: D5901625

fbshipit-source-id: 7d3797286e4040575b9b5503c776bff1e29b67a9
  • Loading branch information
aforismesen authored and facebook-github-bot committed Sep 29, 2017
1 parent 17b96ad commit 5f7642d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/component/base/DraftEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {

const contentStyle = {
outline: 'none',
// fix parent-draggable Safari bug. #1326
userSelect: 'text',
WebkitUserSelect: 'text',
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
};
Expand Down

0 comments on commit 5f7642d

Please sign in to comment.