Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a visual indicator to link taps in markdown #1540

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Ensure indicator is displayed even for super quick taps
  • Loading branch information
micahmo committed Aug 20, 2024
commit db5f480777c3b3e6b70dfe7df728dcd6a9f87950
10 changes: 7 additions & 3 deletions lib/shared/common_markdown_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 138,13 @@ class _CommonMarkdownBodyState extends State<CommonMarkdownBody> {
setState(() {});
},
onElementStoppedBeingTapped: (element) {
elementsBeingTapped.remove(element);
_extendedMarkdownBody?.forceParseMarkdown?.call();
setState(() {});
// Add a tiny delay before removing the element.
// This allows the visual indication to be displayed, even if the user taps very quickly
Future.delayed(const Duration(milliseconds: 50), () {
elementsBeingTapped.remove(element);
_extendedMarkdownBody?.forceParseMarkdown?.call();
setState(() {});
});
},
),
},
Expand Down
Loading