Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Prevent crash when setting cursor style #3097

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

m-bert
Copy link
Contributor

@m-bert m-bert commented Sep 13, 2024

Description

If you try to set cursor style in our buttons on iOS you'll get unrecognized selector error. This PR sets cursor value to be undefined on iOS, so apps no longer crash.

Fixes #3081

Test plan

Tested on the following code:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { RectButton } from 'react-native-gesture-handler';

export default function EmptyExample() {
  return (
    <View style={styles.container}>
      <Text>Hello World!</Text>

      <RectButton
        style={{
          width: 100,
          height: 20,
          backgroundColor: 'blue',
          cursor: 'grab',
        }}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

@m-bert m-bert merged commit bf3ddd3 into main Sep 16, 2024
1 check passed
@m-bert m-bert deleted the @mbert/prevent-cursor-crash-ios branch September 16, 2024 14:13
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.

Crash on iOS when setting cursor style
2 participants