diff --git a/packages/tiptap-extensions/src/extensions/Search.js b/packages/tiptap-extensions/src/extensions/Search.js index 624e8484b..e76c5e3be 100644 --- a/packages/tiptap-extensions/src/extensions/Search.js +++ b/packages/tiptap-extensions/src/extensions/Search.js @@ -25,6 +25,7 @@ export default class Search extends Extension { searching: false, caseSensitive: false, disableRegex: true, + alwaysSearch: false, } } @@ -121,7 +122,7 @@ export default class Search extends Extension { state: { init() { return DecorationSet.empty }, apply: (tr, old) => { - if (this.options.searching) { + if (this.options.searching || (tr.docChanged && this.options.alwaysSearch)) { return this.createDeco(tr.doc) } if (tr.docChanged) {