Skip to content

Commit

Permalink
Ensure indicator is displayed even for super quick taps
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo committed Aug 20, 2024
1 parent aa7334d commit db5f480
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit db5f480

Please sign in to comment.