Giter VIP home page Giter VIP logo

draft-extend's Issues

Middleware swallowing errors

For a while, I was seeing this cryptic error message:

image

After a bit of digging, I found that I had an error in my textToEntity middleware that was getting swallowed by the middleware handler, I assume here:

I've worked around this for now by wrapping the contents of my middleware with a try/catch and logging the error.

Update docs and examples to use the draft-js v0.10 API

Deprecation warnings about key binding props after upgrading to draft-js 0.11.1

After upgrading to draft-js 0.11.1, the following deprecation warnings appear in the console:

Supplying an `onDownArrow` prop to `DraftEditor` has been deprecated. If your handler needs access to the keyboard event, supply a custom `keyBindingFn` prop that falls back to the default one (eg. https://is.gd/RG31RJ). 
    in DraftEditor (created by EditorWrapper)
    in EditorWrapper (created by KeyCommandController(EditorWrapper))
    in KeyCommandController(EditorWrapper) (created by Anonymous)
    ...

Supplying an `onEscape` prop to `DraftEditor` has been deprecated. If your handler needs access to the keyboard event, supply a custom `keyBindingFn` prop that falls back to the default one (eg. https://is.gd/RG31RJ). 

Supplying an `onTab` prop to `DraftEditor` has been deprecated. If your handler needs access to the keyboard event, supply a custom `keyBindingFn` prop that falls back to the default one (eg. https://is.gd/RG31RJ). 

Supplying an `onUpArrow` prop to `DraftEditor` has been deprecated. If your handler needs access to the keyboard event, supply a custom `keyBindingFn` prop that falls back to the default one (eg. https://is.gd/RG31RJ). 

It looks like the default key bindings have changed and the convenience on* handlers have been deprecated.

Support editorClassName

We'd like to be able to target the draft-extend-editor in our styling, but are concerned about styling a class name that we didn't provide. We would like the draft extend editor to take in an editorClassName prop which is applied to the draft-extend-editor node, so that we can provide a className to style.

cc @bent0b0x

See LiveMessagesUI pull #2847 on the HubSpot internal git for futher context.

Plugins should have a chance to handle key commands before editor

With the current implementation, plugins don't receive an event if the same event is handle by the editor.

I'm trying to select a component with return from a menu in an overlay but since I also handle return in my editor, the overlay never gets the event. My current solution is to track when the overlay is active.

The change to let the plugins handle the event first seems straight forward but I wanted to make sure I'm not missing something before submitting a PR

Thank you

Entity.create deprecated

I'm seeing the following warnings using the example textToEntity middleware:

DraftEntity.js:35 WARNING: DraftEntity.create will be deprecated soon!
Please use "contentState.createEntity" instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.