Skip to content

Invalid prop toolbar supplied to RichTextInput #3022

Description

@batbyR

For the need of my project, I have added a custom toolbar to my RichTextInput field. It worked like a charm except a console warning.

What you were expecting:
Using a custom toolbar in a RichTextInput (following quill documentation) should not print a warning in the console.

What happened instead:

I got this console warning:
Capture d’écran 2019-03-19 à 11 57 19

Steps to reproduce:

In react-admin demo, add a custom toolbar in the TagEdit file.

Related code:

 <RichTextInput
        source="description"
        addLabel={false}
        toolbar={quillToolbarOptions}
      />
const quillToolbarOptions = {
  container: [
    [{ header: [1, 2, 3, false] }],
    ["bold", "italic", "underline", "link"],
    [{ list: "ordered" }, { list: "bullet" }],
    ["clean"],
    ["link"]
  ],
  handlers: {
    // handlers object will be merged with default handlers object
    link: function(value) {
      if (value) {
        var href = prompt("Enter the URL");
        this.quill.format("link", href);
      } else {
        this.quill.format("link", false);
      }
    }
  }
};

Other information:

Environment

  • React-admin version: 2.6.2
  • Last version that did not exhibit the issue (if applicable):
  • React version: 16.4.16
  • Browser: Chrome
  • Stack trace (in case of a JS error): see above

Activity

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

      Issue actions