Editor is not scrolled into view when focusing the editor on iOS
The editor is not scrolled into view when focusing on iOS. You can reproduce this by following the steps below.
- Start from the rich text example (https://github.com/facebook/draft-js/tree/master/examples/rich)
- Add a lot of random content above the editor, so that you have to scroll down to see the editor.
- Open the example in iOS and scroll down to the editor.
- Tap on the editor so that it gains focus.
- Result: the on-screen keyboard appears, but the page is scrolled to completely the wrong location, so that the editor is invisible. See screenshots below.

It seems that calling focus() on the editor causes this behaviour. According to the documentation of that method, "Forcing focus causes the browser to scroll to the top of the editor", but this apparently does not work correctly for iOS.
The iOS WebView needs to have its frame dimensions set to the device's. The editor content element also needs updated height styling set when the keyboard is shown/hidden. I'll try to provide some example code later today, if that will help.
ZSS is a good template for working with DraftJS+iOS. However, the editing toolbar on mobile is a wildcard here. I haven't seen many mobile toolbars done well in html, at least for iOS. It'd be nice to see one, of course. :-) ZSS uses swizzling to bring theirs native.
Example of the iOS keyboard visibility event:
You can use that event to notify your react code of the keyboard status change, with the content and footer height information. The ZSS WebView configuration/init example also works pretty well applied to DraftJS.
Example of html/css needed to support iOS keyboard visibility w/contenteditable:
When updating DraftJS from iOS, the following seems to work as a fairly solid hack. If there's a way to do any of this better, please do share:
Set DraftJS content height
const contentHeight = iOSData.contentHeight;
let adjustedHeight;
if (contentHeight > 600) {
adjustedHeight = contentHeight - 17;
} else {
adjustedHeight = contentHeight - 3;
}
const myElements = document.querySelectorAll('.public-DraftEditor-content');
const len = myElements.length;
for (let i = 0; i < len; i++) {
const myElement = myElements[i];
myElement.style.overflow = 'auto';
myElement.style.height = null;
const adjustedHeightStyle = `${adjustedHeight}px`;
myElement.style.minHeight = adjustedHeightStyle;
myElement.style.maxHeight = adjustedHeightStyle;
}
Set DraftJS footer height
const footerHeight = iOSData.footerHeight;
const editorFooter = document.getElementById(elementId);
const heightStyle = `height:${footerHeight}px`;
editorFooter.setAttribute('style', heightStyle);
editorFooter.style.height = `${footerHeight}px`;
Closing this, as @TheTekton has provided a solution. Feel free to ping in if we should look into this further