Skip to content

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Nov 4, 2025

Description

Native gesture was incorrectly attached when underlying view was UIControl. This PR aims to fix this. It also changes hostDetectorTag to hostDetectorView, which simplifies viewForEvents logic.

Test plan

Tested on the following code:
import { StyleSheet } from 'react-native';
import {
  GestureDetector,
  GestureHandlerRootView,
  PureNativeButton,
  useNative,
} from 'react-native-gesture-handler';

const Button = ({ nativeGestureProperties }: any) => {
  const native = useNative(nativeGestureProperties);

  return (
    <GestureDetector gesture={native}>
      <PureNativeButton
        style={{ width: 100, height: 20, backgroundColor: 'green' }}
      />
    </GestureDetector>
  );
};

export default function App() {
  return (
    <GestureHandlerRootView style={styles.container}>
      <Button
        nativeGestureProperties={{
          onEnd: () => {
            console.log('end');
          },
          disableReanimated: true,
        }}
      />
    </GestureHandlerRootView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'space-around',
    alignItems: 'center',
  },
});

@m-bert m-bert requested a review from j-piasecki November 4, 2025 14:31
@m-bert m-bert changed the title [iOS] Correctly attach NativeViewGestureHandler [iOS] Correctly attach Native gesture Nov 4, 2025
@m-bert m-bert requested a review from akwasniewski November 4, 2025 14:32
@m-bert m-bert requested a review from j-piasecki November 12, 2025 15:14
@m-bert
Copy link
Contributor Author

m-bert commented Nov 12, 2025

As discussed offline, I've changed this approach. Let me know what you think (cc @j-piasecki, @akwasniewski)

@m-bert m-bert requested a review from j-piasecki November 12, 2025 16:29
@m-bert m-bert merged commit 34c70f2 into next Nov 13, 2025
3 checks passed
@m-bert m-bert deleted the @mbert/fix-buttons-ios branch November 13, 2025 15:41
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.

4 participants