editor: Fix sometimes green (+) cursor style appearing when cmd-clicking in same buffer (#34638)

Smit Barmase created

Follow-up for https://github.com/zed-industries/zed/pull/34557

This PR clears the selection drag state on click, because mouse up
doesn't trigger on click event because of `cx.stop_propagation`. The
issue occurs with similar repro steps as mentioned in the attached PR.

Release Notes:

- Fixed the issue where the green (+) cursor style sometimes appears
when navigating to the definition in buffer.

Change summary

crates/editor/src/element.rs | 1 +
1 file changed, 1 insertion(+)

Detailed changes

crates/editor/src/element.rs 🔗

@@ -949,6 +949,7 @@ impl EditorElement {
         if !pending_nonempty_selections && hovered_link_modifier && text_hitbox.is_hovered(window) {
             let point = position_map.point_for_position(event.up.position);
             editor.handle_click_hovered_link(point, event.modifiers(), window, cx);
+            editor.selection_drag_state = SelectionDragState::None;
 
             cx.stop_propagation();
         }