react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

[Bug] the hitSlop value should use float on android like on ios

Open GrinZero opened this issue 1 year ago • 1 comments
trafficstars

Description

On IOS, the hitSlop attribute of Svg supports the direct use of hitSlope={4}, but it can cause crashes on Android. The native view is also compatible with this writing style, so I think we should add compatibility in this area, otherwise it may lead to hidden cross end compatibility issues.

Steps to reproduce

On any android deviced use the code like <Svg hitSlop={4}/>

  1. open the snack link, the device can not been open with hitSlop={40}
  2. change the code to hitSlop={{top:40,bottom:40,left:40,right:40}}, the device can run success.

Snack or a link to a repository

https://snack.expo.dev/@bugyaluwang/react-native-svg-hit

SVG version

15.3.0

React Native version

0.74.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Go

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

Real device

Device model

MEIZU 20 Pro

Acknowledgements

Yes

GrinZero avatar Jul 03 '24 10:07 GrinZero

this PR is ready for this issues: https://github.com/software-mansion/react-native-svg/pull/2323

GrinZero avatar Jul 03 '24 10:07 GrinZero

Hi @GrinZero, I've made a PR solving this issue https://github.com/software-mansion/react-native-svg/pull/2407 with iOS and Android support. Thank you!

jakex7 avatar Aug 26 '24 12:08 jakex7