withspectrum / draft-js-markdown-plugin

An opinionated DraftJS plugin for supporting Markdown syntax shortcuts
https://markdown-plugin.spectrum.chat/
MIT License
139 stars 42 forks source link

List not indenting on tab #175

Open johnstew opened 5 years ago

johnstew commented 5 years ago

Hi there, it looks like this was brought up in #59 but then closed. But I tried recreating a small example on codesandbox and it seems the issue is still there versus in the examples it works just fine. Wondering if it's a setup issue.

I'm explicitly passing in the features options even though I think they are all enabled by default.

https://codesandbox.io/s/rmn008n5ko

import React, { Component } from "react";
import ReactDOM from "react-dom";
import Editor from "draft-js-plugins-editor";
import createMarkdownPlugin from "draft-js-markdown-plugin";
import { EditorState } from "draft-js";

export default class DemoEditor extends Component {
  state = {
    editorState: EditorState.createEmpty(),
    plugins: [
      createMarkdownPlugin({
        features: {
          inline: ["BOLD", "ITALIC", "CODE", "STRIKETHROUGH", "LINK", "IMAGE"],
          block: [
            "header-one",
            "header-two",
            "header-three",
            "header-four",
            "header-five",
            "header-six",
            "ordered-list-item",
            "unordered-list-item"
          ]
        }
      })
    ]
  };

  onChange = editorState => {
    this.setState({
      editorState
    });
  };

  render() {
    return (
      <Editor
        editorState={this.state.editorState}
        onChange={this.onChange}
        plugins={this.state.plugins}
      />
    );
  }
}