react-trix icon indicating copy to clipboard operation
react-trix copied to clipboard

Needed additional props

Open airled opened this issue 5 years ago • 2 comments

Hi there. I saw this issue https://github.com/dstpierre/react-trix/issues/28. It is also needed to have possibility to pass locales (trix uses locales like this) and hide buttons via props.

airled avatar Mar 02 '20 13:03 airled

I'll try to check this for the next release, I just published v0.7.0.

If someone want to tackle this one I'll be happy to review and publish an update.

dstpierre avatar Mar 03 '20 12:03 dstpierre

Hey @airled I'm updating react-trix for the version 1.3.1 of Trix and I was looking at your issue regarding locale. Would the onEditorReady event which pass a reference the Trix's editor could be a good workaround, for instance:

export class Test extends React.Component {
  handleEditorReady(editor) {
    // can the locale be set directly in the editor here?
    // do editing programatically
    editor.insertString("editor is ready");
  }
  render() {
    return (
      <TrixEditor onEditorReady={this.handleEditorReady} />
    );
  }
}

I haven't investigate that much, it's just a quick work around idea.

dstpierre avatar Mar 31 '22 11:03 dstpierre