From 01514d6b5fa52dbc5a75121d37a97bf62ade1e1b Mon Sep 17 00:00:00 2001 From: Ayushman Pal <166608111+WannaCry016@users.noreply.github.com> Date: Fri, 2 May 2025 01:43:01 +0530 Subject: [PATCH] Update json_explorer.dart --- .../json_explorer/lib/src/json_explorer.dart | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/json_explorer/lib/src/json_explorer.dart b/packages/json_explorer/lib/src/json_explorer.dart index 4145d6229..2a666bebc 100644 --- a/packages/json_explorer/lib/src/json_explorer.dart +++ b/packages/json_explorer/lib/src/json_explorer.dart @@ -288,17 +288,19 @@ class JsonAttribute extends StatelessWidget { node.highlight(isHighlighted: false); node.focus(isFocused: false); }, - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: hasInteraction - ? () { - if (valueStyle.onTap != null) { - valueStyle.onTap!.call(); - } else { - _onTap(context); - } - } - : null, + child: Listener( + behavior: HitTestBehavior.translucent, + onPointerDown: (_) { + node.highlight(); + node.focus(); + if (hasInteraction) { + if (valueStyle.onTap != null) { + valueStyle.onTap!.call(); + } else { + _onTap(context); + } + } + }, child: AnimatedBuilder( animation: node,