Skip to content

Improve Card hit-testing and border rendering in SUCard #100

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

Merged
merged 4 commits into from
Jun 20, 2025

Conversation

VislovIvan
Copy link
Collaborator

@VislovIvan VislovIvan commented Jun 19, 2025

Changes

  1. Problem: Border clipping
    Prevents half the border from being clipped by drawing the line inside the shape:
    .strokeBorder() instead of .stroke()

  2. Problem: Taps don’t register on transparent areas
    Adding .contentShape(.rect) makes transparent regions tappable.

  3. Problem: Taps on child views trigger the card’s tap handler
    With isTappable enabled, any touch inside the card, including taps on buttons or checkboxes, still fires the card’s own tap action. Subviews should handle their taps independently.

SwiftUI fix:
Replaced the .simultaneousGesture() with .gesture(DragGesture(minimumDistance: 0.0)...)

@mikhailChelbaev mikhailChelbaev changed the title Improve Card hit-testing and border rendering in SUCard & UKCard Improve Card hit-testing and border rendering in SUCard Jun 20, 2025
@mikhailChelbaev mikhailChelbaev merged commit b582cb9 into main Jun 20, 2025
1 check passed
@mikhailChelbaev mikhailChelbaev deleted the card-bug-fix branch June 20, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants