ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

Bug in search-highlight example: `setValue({decoration})` will disable redo #1454

Closed zhujinxuan closed 6 years ago

zhujinxuan commented 6 years ago

Do you want to request a feature or report a bug?

Report a bug.

What's the current behavior?

In the search-highlight example, http://slatejs.org/#/search-highlighting , in each time the search-box onChange is triggered, the redo will be cleaned setValue({decoration}). Then redo will be disabled by the search-box change.

What's the expected

Just wondering if it is possible to re-rendering decorationNode or forceUpdate from the outside?

SmilinBrian commented 6 years ago

1458 shows more clearly why a different way to trigger re-building the decorations is useful, but this issue more clearly requests the functionality.

@zhujinxuan would you consider putting your animated GIF and explanation here and close 1458?

zhujinxuan commented 6 years ago

@SmilinBrian Sorry I forgot to close the request after know setOperationFlag... I will simply send a PR to add setOperationFlag to the example and close this commit.

Thank you~