mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 19:29:02 +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,
|
searching: false,
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
disableRegex: true,
|
disableRegex: true,
|
||||||
|
alwaysSearch: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ export default class Search extends Extension {
|
|||||||
state: {
|
state: {
|
||||||
init() { return DecorationSet.empty },
|
init() { return DecorationSet.empty },
|
||||||
apply: (tr, old) => {
|
apply: (tr, old) => {
|
||||||
if (this.options.searching) {
|
if (this.options.searching || (tr.docChanged && this.options.alwaysSearch)) {
|
||||||
return this.createDeco(tr.doc)
|
return this.createDeco(tr.doc)
|
||||||
}
|
}
|
||||||
if (tr.docChanged) {
|
if (tr.docChanged) {
|
||||||
|
Loading…
Reference in New Issue
Block a user