Skip to content

Background cards in a DeckView still allow hit testing #13

@DandyLyons

Description

@DandyLyons

It's surprising that background cards (any card that is not the top card) in a DeckView still allow hit testing. If and when a user accidentally starts a drag on a background card they will put the app into an unpredictable state.

It would be nice if the library added the ability to turn off hit testing for background cards. (Perhaps there are use cases where dragging background cards would still be desirable (for example if the cards are in a fan layout). So perhaps turning off hit testing should be optional and not automatic.)

Current Workaround

It's not hard for the user to manually turn off hit testing if the card is not the first card. They could do something like this.

DeckView($items) { item in 
  ItemView(item: item)
    .allowsHitTesting(item.id == item.first?.id)
}

If this feature should not be directly supported in the library it could be helpful to make this suggestion in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adjustmentChanges to existing functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions