jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.42k stars 1.16k forks source link

Suggestions add url even though it doesn't exist #582

Open sahar922 opened 6 years ago

sahar922 commented 6 years ago

Hey all :) I'm using latest react-draft-wysiwyg version, according to the official docs, if the suggestions don't have "url" property, it'll take the action only but in my case, it adds a link to localhost as well.

my editor config :

                 <Editor
                  editorState={editorState}
                  editorClassName="editor-class"
                  onEditorStateChange={this.onEditorStateChange}
                  mention={{
                      separator: ' ',
                      trigger: '{',
                      suggestions: [
                        { text: 'Name', value: 'userName}' },
                        { text: 'Email', value: 'email}' },
                        { text: 'Company Name', value: 'companyName}'}
                      ],
                    }}
                  toolbar={Klass.toolbar}
                    />

onEditorStateChange :

  onEditorStateChange(editorState){
    this.setState(
        {
        editorState
        });
}

what am I doing wrong?

Thanks!

sahar922 commented 6 years ago

@jpuri any ideas? thanks a lot

sahar922 commented 6 years ago

@jpuri can you take a look, please?