react-frame-aware-selection-plugin
Modified version of React SelectEventPlugin with fixes related to iframe rendering.
Usage
-
Add npm package
Latest
npm install react-frame-aware-selection-plugin@2.0.0 --save
React >= 15.4 && < 16.0.0
npm install react-frame-aware-selection-plugin@1.0.0 --save
React < 15.4
npm install react-frame-aware-selection-plugin@0.0.5 --save
-
In you app entry point:
;
Motivation
Current React version does not support onSelect event if component is embedded to iFrame. Consider following code:
const AwesomeFramedComponent = <Frame> <div contentEditable="true" onSelect=onSelect></div> </Frame>
In such situation onSelect
callback will not be fired.
This library will fix this behaviour.
Hot it works
Library will replace SelectEventPlugin
in EventPluginRegistry
with fixed version.