From 45ad7eeff745f0c6f460e3377ab1ff9aaacc6d69 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Sun, 25 Mar 2018 23:17:47 +0200 Subject: [PATCH] Let browser insert text --- plugin-api/alpha/client/hocs/index.js | 1 + .../client/components/rte/RTE.js | 16 +++------------- 2 files changed, 4 insertions(+), 13 deletions(-) create mode 100644 plugin-api/alpha/client/hocs/index.js diff --git a/plugin-api/alpha/client/hocs/index.js b/plugin-api/alpha/client/hocs/index.js new file mode 100644 index 000000000..3c860c7f5 --- /dev/null +++ b/plugin-api/alpha/client/hocs/index.js @@ -0,0 +1 @@ +export { withSlotElements } from 'coral-framework/hocs'; diff --git a/plugins/talk-plugin-rich-text/client/components/rte/RTE.js b/plugins/talk-plugin-rich-text/client/components/rte/RTE.js index a33889ea6..3726fb7c1 100644 --- a/plugins/talk-plugin-rich-text/client/components/rte/RTE.js +++ b/plugins/talk-plugin-rich-text/client/components/rte/RTE.js @@ -79,9 +79,9 @@ class RTE extends React.Component { forEachFeature(callback) { Object.keys(this.featuresRef).map(k => { - const instance = this.featureRef[k].getFeatureInstance - ? this.featureRef[k].getFeatureInstance() - : this.featureRef[k]; + const instance = this.featuresRef[k].getFeatureInstance + ? this.featuresRef[k].getFeatureInstance() + : this.featuresRef[k]; callback(instance); }); } @@ -248,16 +248,6 @@ class RTE extends React.Component { } }; - handleKeyPress = e => { - const character = String.fromCharCode(e.charCode); - if (character) { - insertText(character); - this.handleChange(); - e.preventDefault(); - return false; - } - }; - restoreCheckpoint(html, node, range) { if (node && range) { // We need to clone it, otherwise we'll mutate