@seafile/sdoc-editor 2.0.47 → 2.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,8 +153,11 @@ const SdocEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
153
153
  }), [document, validEditor, slateValue]);
154
154
  const onValueChange = value => {
155
155
  const eventBus = _basicSdk.EventBus.getInstance();
156
- eventBus.dispatch(_constants.INTERNAL_EVENT.UPDATE_SEARCH_REPLACE_HIGHLIGHT, value);
157
156
  setSlateValue(value);
157
+ // After the content is updated, update the search content
158
+ setTimeout(() => {
159
+ eventBus.dispatch(_constants.INTERNAL_EVENT.UPDATE_SEARCH_REPLACE_HIGHLIGHT, value);
160
+ }, 0);
158
161
  if (_utils.isMobile) {
159
162
  (0, _outlineModule.updateOutlineValue)(value);
160
163
  }
@@ -135,7 +135,10 @@ const WikiEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
135
135
  }), [document, validEditor, slateValue]);
136
136
  const onValueChange = value => {
137
137
  const eventBus = _basicSdk.EventBus.getInstance();
138
- eventBus.dispatch(_constants.INTERNAL_EVENT.UPDATE_SEARCH_REPLACE_HIGHLIGHT, value);
138
+ // After the content is updated, update the search content
139
+ setTimeout(() => {
140
+ eventBus.dispatch(_constants.INTERNAL_EVENT.UPDATE_SEARCH_REPLACE_HIGHLIGHT, value);
141
+ }, 0);
139
142
  setSlateValue(value);
140
143
  };
141
144
  if (isReloading) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "2.0.47",
3
+ "version": "2.0.48",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",