Skip to content

Use onTouchEnd to fix Chromecast button non responsive on Android#115

Open
OlegRyz wants to merge 6 commits into
mainfrom
bugfix/android-chromecast-button-non-responsive
Open

Use onTouchEnd to fix Chromecast button non responsive on Android#115
OlegRyz wants to merge 6 commits into
mainfrom
bugfix/android-chromecast-button-non-responsive

Conversation

@OlegRyz
Copy link
Copy Markdown

@OlegRyz OlegRyz commented May 18, 2026

The onStartShouldSetResponder on the outer Animated.View was claiming the touch responder, preventing the native MediaRouteButton from receiving taps. Replacing it with a
onTouchEnd listener preserves the fade-in behavior without intercepting touches meant for native child views.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: a2a2e80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@theoplayer/react-native-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

onTouchMove={onUserAction_}
onStartShouldSetResponder={() => true}
onResponderRelease={onUserAction_}
onTouchEnd={onUserAction_}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still work on platforms without touch events, i.e. desktop browsers?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it doesn't work for click events, but UI was showing because of onTouchMove initiated. I added onClick to keep showing UI for clicks without movement on web browsers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the type checker doesn't like it...

  Property 'onClick' does not exist on type 'IntrinsicAttributes & AnimatedProps<ViewProps & RefAttributes<View>>'.

440         onClick={onUserAction_}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a wrong way for introducing onClick. However worked runtime... I pushed the proper way now.

@OlegRyz OlegRyz force-pushed the bugfix/android-chromecast-button-non-responsive branch from e2489bb to 4f68630 Compare May 19, 2026 14:46
Copy link
Copy Markdown
Member

@tvanlaerhoven tvanlaerhoven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also verified with the linked example app.

const babelLoaderConfiguration = {
test: [/\.tsx?$/, /.*@theoplayer\/.*\.js$/],
exclude: ['/**/*.d.ts', '/**/node_modules/'],
exclude: [/\.d\.ts$/, /cmcd-connector\.esm\.js$/],
Copy link
Copy Markdown
Contributor

@MattiasBuelens MattiasBuelens May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? What's wrong with cmcd-connector.esm.js? 😕

Could you at least add a comment?

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.

3 participants