Programmatically triggered changes are not being normalized
See original GitHub issueUsing Slate 0.42.2, if you trigger changes programmatically, you need to call normalize()
yourself.
See the bug in action here:
https://jsfiddle.net/gersomvg/fj9dvhom/2451/
I would expect normalization to take place without invoking manually, since the docs state:
The vast majority of changes, whether by the user or invoked programmatically, will run normalize by default to ensure the document is always in adherence to its schema.
I can try to PR this myself, after this is confirmed by someone else as a bug.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
HTML JavaScript onChange Handler is not called when ...
The onchange event is not triggered by a programmatic change of the value of the textinput. You have to call the code you...
Read more >Normalization Data Services
The Normalization Data Services plugin helps maintain consistency for table fields that refer to a company name.
Read more >Changing Directive Inputs Programmatically Won't Trigger ...
So, I hit this issue as well. I was passing a new array into a component but that component's onChanges() lifecycle was not...
Read more >Maybe Normalizing Isn't Normal - Coding Horror
Dare Obasanjo had an excellent post When Not to Normalize your SQL ... The thought being that the database, being as well designed...
Read more >ALTER DATABASE (Transact-SQL) Compatibility Level
Sets Transact-SQL and query processing behaviors to be compatible ... Examples of breaking changes not protected by compatibility level are:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve found a related bug.
If you do this:
Then
normalizeNode
is only invoked once for the divider node and not for the document as a whole.This can be solved again by calling
normalize
manually:Before I also had trouble with normalizing insertBlocks using a regular schema, so I don’t think it’s a problem with only marks @ianstormtaylor 😦
Closing in favor of https://github.com/ianstormtaylor/slate/issues/2312.