Skip to content

Commit

Permalink
feat: support option/cmd + click to open link (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed May 2, 2024
1 parent b377c87 commit f49e733
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';

/// Support Desktop and Web platform
Expand Down Expand Up @@ -30,7 +31,11 @@ TextSpan defaultTextSpanDecoratorForAttribute(
// implement a simple double tap logic
tapCount += 1;
timer?.cancel();
if (tapCount == 2 || !editorState.editable) {
// meta / ctrl + click to open the link
if (tapCount == 2 ||
!editorState.editable ||
HardwareKeyboard.instance.isControlPressed ||
HardwareKeyboard.instance.isMetaPressed) {
tapCount = 0;
safeLaunchUrl(href);
return;
Expand Down

0 comments on commit f49e733

Please sign in to comment.