Skip to content

Commit

Permalink
Fix: context menu is visible even when selection is collapsed (#2116)
Browse files Browse the repository at this point in the history
* Fix: context menu is visible even when selection is collapse

* Chore: dart fixes

* Fix: context menu fails by null value when try to update the view

---------

Co-authored-by: CatHood0 <santiagowmar@gmail.com>
  • Loading branch information
CatHood0 and CatHood0 authored Aug 17, 2024
1 parent 2342509 commit b894c5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/editor/raw_editor/raw_editor_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,10 @@ class QuillRawEditorState extends EditorState

void _updateOrDisposeSelectionOverlayIfNeeded() {
if (_selectionOverlay != null) {
if (_hasFocus) {
if (!_hasFocus || textEditingValue.selection.isCollapsed) {
_selectionOverlay?.dispose();
_selectionOverlay = null;
} else if (_hasFocus) {
_selectionOverlay!.update(textEditingValue);
}
} else if (_hasFocus) {
Expand Down

0 comments on commit b894c5f

Please sign in to comment.