mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 11:09:01 +08:00
add option to always update search results
This commit is contained in:
parent
0e5aa7f116
commit
d3514c3d36
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user