From 9ed9c935407dd0f7a8b54bf8454105e734945df9 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Mon, 19 Jan 2026 12:09:57 -0500 Subject: [PATCH] Refactor InteractiveChip component to improve touch event handling This commit updates the InteractiveChip component by refining touch event handling for better user interaction on touch devices. The `HandleClick` method has been replaced with `HandleTouchStart`, which now toggles the `_isTouched` state and prevents event propagation. This change enhances the responsiveness of the component, ensuring a smoother experience for users on mobile devices while maintaining existing hover functionality for desktop users. --- .../Shared/Components/InteractiveChip.razor | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/WebApp/Components/Shared/Components/InteractiveChip.razor b/WebApp/Components/Shared/Components/InteractiveChip.razor index 05162b6..703e5bc 100644 --- a/WebApp/Components/Shared/Components/InteractiveChip.razor +++ b/WebApp/Components/Shared/Components/InteractiveChip.razor @@ -6,9 +6,8 @@ Class="@WrapperClass" @onmouseenter="@(() => _isHovered = true)" @onmouseleave="@(() => _isHovered = false)" - @ontouchstart="@(() => _isTouched = true)" - @ontouchend="@(() => { /* Prevent mouse events on touch */ })" - @onclick="@HandleClick"> + @ontouchstart="@HandleTouchStart" + @ontouchend="@((e) => { e.PreventDefault(); })">