Skip to content

Link decorator not work with plugin #395

Closed
@DerekHung

Description

@DerekHung

Hello
When I use from draft-js-plugins
I found that the DraftJS example : link didn't work with plugin's
It looks like decorator didn't has any effect

const decorator = new CompositeDecorator([ { strategy: findLinkEntities, component: Link, }, ]);

I have a sample code in this repo : https://github.com/DerekHung/link-draft-plugin-example

Would you help to solve this problem?

Thanks~

Activity

adrianmcli

adrianmcli commented on Aug 19, 2016

@adrianmcli
Member

So let me clarify here. You're not trying to use the Link plugin? You are trying to use the draft-js-plugins editor, but it seems to be breaking the official draft-js link example?

DerekHung

DerekHung commented on Aug 20, 2016

@DerekHung
Author

Yes,
I only use the draft-js-plugins component

DerekHung

DerekHung commented on Aug 23, 2016

@DerekHung
Author

@adrianmc do you have any idea about this bug?

mzbac

mzbac commented on Aug 29, 2016

@mzbac
Contributor

refer to FAQ.m. we are able to pass custom decorators on decorators props

const customDecorators = [
  {
    strategy: findLinkEntities,
    component: Link,
  },
];

// Editor accepts a prop called decorators. 
const MyEditor = ({ editorState, onChange }) => (
  <Editor
    editorState={editorState}
    onChange={onChange}
    decorators={customDecorators}
    plugins={[plugin1, plugin2]}
  />
);
nazarposhta

nazarposhta commented on Jun 19, 2018

@nazarposhta

@DerekHung did you resolve that problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nikgraf@adrianmcli@mzbac@nazarposhta@DerekHung

        Issue actions

          Link decorator not work with plugin · Issue #395 · draft-js-plugins/draft-js-plugins