Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ class _MobileSelectionServiceWidgetState
shiftWithBaseOffset: true,
);

if (node == null || rects == null || rects.isEmpty) {
if (node == null ||
rects == null ||
rects.isEmpty ||
editorState.selectionUpdateReason ==
SelectionUpdateReason.searchHighlight) {
return const SizedBox.shrink();
}

Expand Down
26 changes: 3 additions & 23 deletions lib/src/editor/find_replace_menu/search_service_v3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,10 @@ class SearchServiceV3 {
);

if (matchWrappers.value.isEmpty || unHighlight) {
editorState.updateSelectionWithReason(
null,
reason: SelectionUpdateReason.searchHighlight,
extraInfo: {
selectionExtraInfoDoNotAttachTextService: true,
},
);
} else {
selectedIndex = selectedIndex;
_highlightCurrentMatch(
pattern,
);
return;
}
selectedIndex = selectedIndex;
_highlightCurrentMatch(pattern);
}

List<MatchWrapper> _getMatchWrappers({
Expand Down Expand Up @@ -160,17 +151,6 @@ class SearchServiceV3 {
if (jumpInterceptor?.call(path) == false) {
editorState.scrollService?.jumpTo(path.first);
}

editorState.updateSelectionWithReason(
selection,
reason: SelectionUpdateReason.searchHighlight,
extraInfo: {
selectionExtraInfoDisableToolbar: true,
selectionExtraInfoDoNotAttachTextService: true,
selectionExtraInfoDisableMobileToolbarKey: true,
selectionExtraInfoSelectionRadius: 6.0,
},
);
}

/// This method takes in a boolean parameter moveUp, if set to true,
Expand Down
Loading