Skip to content

ianstormtaylor/react-frame-aware-selection-plugin

 
 

Repository files navigation

react-frame-aware-selection-plugin

Modified version of React SelectEventPlugin with fixes related to iframe rendering.

Travis build status Dependency Status devDependency Status

  1. Usage
  2. Motivation
  3. How it works

Usage

  1. Add npm package

    npm install react-frame-aware-selection-plugin --save

  2. In you app entry point:

    import React from 'react'
    import ReactDOM from 'react'
    import injector from 'react-frame-aware-selection-plugin'
    injector();

Motivation

Current React version does not support onSelect event if component is embedded to iFrame. Consider following code:

import Frame from 'react-frame-component'

const AwesomeFramedComponent = ({ onSelect }) => (
  <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.

About

No description, website, or topics provided.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-react.md

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%