Open callmeberzerker opened 5 years ago
Just hit that same issue while working on https://github.com/timonweb/non-admin-draftail, thanks for bringing that up. For now a quick fix is to pin draft-js
version to 0.10.5
.
Hi all. Is there any news regarding this one?
I actually cloned the repo and tried to fix it. It looks like that this issue is connected with https://github.com/facebook/draft-js/commit/8473e411cec7b4ec64029723b8df2084c1dbcb00#diff-509bed42dbb17a2aef5c4ed42ce87170 update.
In https://github.com/springload/draftail/blob/master/lib/api/behavior.js#L123 this line will return false
which won't pass that if
since it was changed from (!command)
=> (command == null || command === '')
.
The fix should be easy and something like this: return hasCmd(e) ? styles[INLINE_STYLE.BOLD]: null;
If we update to the newest version 0.11.6
, there is also one update that will make unit tests to fail. https://github.com/facebook/draft-js/commit/13989e313da64392f72309d593669ff115348391 They changed how entity ids are generated and now tests like this one: https://github.com/springload/draftail/blob/master/lib/components/DraftailEditor.test.js#L987 won't work since incremental id is sent.
Anyway, there are some problems with plugins and 0.10.5
so it will be really cool if it is possible to update this. If you need any help please let me know.
Edited: I forked and created this MR in my repo: https://github.com/BSStefan/draftail/pull/1, can someone from maintainer take a look?
👋 sorry it’s been so slow-moving – I’ll try to get to this in November, hopefully along with React 17 compatibility.
One of the main reasons this has dragged on is that https://github.com/draft-js-plugins/draft-js-plugins made their 0.11 switch as a breaking change, and I haven’t found enough compelling reasons to start using Draft.js v0.11 to justify the breaking change for Draftail. Hopefully there are more compelling reasons now than a year ago when I started #186. It might also make sense for me to make the draft-js-plugins
dependency optional, for the vast majority of use cases that don’t need it.
Thank you @BSStefan for taking a look at the changes and likely fixes – I’ll make sure to reuse this in the upgrade!
This has stalled again. I’ve done a thorough review of the changes in Draft.js v0.11 back in November, and found more reasons to not upgrade than to upgrade. Specifically:
And then things that are definitely nice, but really pretty small:
And finally, things that are sorely missing in my opinion:
Anyway, we’ll get there eventually. Here are the practical next steps for me:
The main blocker for now is to get access to a Windows 10 machine for testing, with a Word license.
If someone wants to help with v0.11 support, the "nested lists incrementing restrictions" point from above is what would be the simplest to make a PR for directly in the editor.
Draft.js commits from v0.10.5 to v0.11.7 (filtering out any tooling-related changes): Comparing v0.10.5...v0.11.7 · facebook_draft-js (2020-11-18 22_58_04).html.zip
CHANGELOG redux with only the changes I think actually matter:
Hi there!
Since 0.11.0 is released by
draft-js
it will be good ifDraftail
supports it as well. At the moment most of the things work out of box - but some chars (like B, I V - shortcut keys) are getting swallowed when you type into the editor.