Slate: No Line Breaks on Enter By Default?

Created on 23 Dec 2016  路  4Comments  路  Source: ianstormtaylor/slate

I just wanted to confirm this is the normal behavior and that I've not done something wrong in setup. Thanks!

Most helpful comment

@mbessieres I agree with you about that being confusing. I've opened https://github.com/ianstormtaylor/slate/issues/1311 to account for it in a future breaking release.

All 4 comments

I don't know what I did wrong, but I did manage to get it working. For reference to any future people, there should be line breaks on enter by default.

For anyone coming across this now, I discovered that returning false in your onKeyDown function when the enter key is pressed will prevent line breaks. So don't return anything and you're fine. It violates consistent-return considering when you do want something handled, you're returning true, but it solves the problem.

@mbessieres I agree with you about that being confusing. I've opened https://github.com/ianstormtaylor/slate/issues/1311 to account for it in a future breaking release.

Awesome, thanks @ianstormtaylor.

Was this page helpful?
0 / 5 - 0 ratings