Use onTouchEnd to fix Chromecast button non responsive on Android#115
Use onTouchEnd to fix Chromecast button non responsive on Android#115OlegRyz wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: a2a2e80 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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_} |
There was a problem hiding this comment.
Does this still work on platforms without touch events, i.e. desktop browsers?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Hmm, the type checker doesn't like it...
Property 'onClick' does not exist on type 'IntrinsicAttributes & AnimatedProps<ViewProps & RefAttributes<View>>'.
440 onClick={onUserAction_}
There was a problem hiding this comment.
That was a wrong way for introducing onClick. However worked runtime... I pushed the proper way now.
…nction to reflect real name for that events according to W3C
e2489bb to
4f68630
Compare
tvanlaerhoven
left a comment
There was a problem hiding this comment.
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$/], |
There was a problem hiding this comment.
Huh? What's wrong with cmcd-connector.esm.js? 😕
Could you at least add a comment?
The
onStartShouldSetResponderon the outer Animated.View was claiming the touch responder, preventing the nativeMediaRouteButtonfrom receiving taps. Replacing it with aonTouchEndlistener preserves the fade-in behavior without intercepting touches meant for native child views.