Skip to content

Conversation

@AndersKlint
Copy link
Contributor

@AndersKlint AndersKlint commented Mar 22, 2025

Issue

Fixes: Feature Request: TransformableBox should enable onTap Event Propagation to Child Widgets #31

Problem statement

Currently the TransformableBox captures all tap events and forwards them to the onTap callback. This becomes problematic if we want the content of the TransformableBox to capture onTap events (or whatever is rendered behind the box, in case the content is ignoring pointer events).

Testing

Manual testing have been performed with the following setup:

// pseudo  code
stack: [
  GeastureDetector(
    onTap: _onTap,
    child: CameraPreview()
  ), 
  TransformableBox(
     // ... //
     tapThrough: true,
      },
      contentBuilder: (context, rect, flip) => IgnorePointer(
        child: DecoratedBox(
          decoration: BoxDecoration(
            border: Border.all(
              width: 2,
            ),
          ),
        ),
      ),
    );
]
  • When the onTap arg was provided, the tap event was captured by the TransformableBox.
  • When the onTap arg was not provided, the tap event was captured by the CameraPreview's GestureDetector.

@docs-page
Copy link

docs-page bot commented Mar 22, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/hyper-designed/box_transform~32

Documentation is deployed and generated using docs.page.

@AndersKlint AndersKlint changed the title feat: add tapThrough property to allow tap passthrough feat: taps should pass through when onTap is unset Mar 22, 2025
@BirjuVachhani
Copy link
Collaborator

LGTM

@BirjuVachhani BirjuVachhani merged commit 30bf209 into hyper-designed:main Mar 26, 2025
2 of 3 checks passed
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.

Feature Request: TransformableBox should enable onTap Event Propagation to Child Widgets

3 participants