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

fix: prevent undefined override props from overriding SVG element props

Open bohdanprog opened this issue 5 months ago • 6 comments

Summary

That PR fixed issue #2693

This change prevents undefined values from being spread into the SVG component props, which could override existing props with undefined values.

expected result: https://www.svgviewer.dev/s/RCPYq8HE https://www.svgviewer.dev/s/lUyhreuZ

Test Plan

You can easily test that solution by running Test2693

Compatibility

OS Implemented
iOS
MacOS
Android
Web

Checklist

  • [x] I have tested this on a device and a simulator
  • [ ] I added documentation in README.md
  • [ ] I updated the typed files (typescript)
  • [ ] I added a test for the API in the __tests__ folder

bohdanprog avatar Jul 31 '25 14:07 bohdanprog

Hey @jakex7, could you take a look at that small PR, thanks ;)

bohdanprog avatar Jul 31 '25 14:07 bohdanprog

@bohdanprog on my end it doesn't seem to be fixed, have you tested on windows as well? image

ClaudiuHBann avatar Jul 31 '25 16:07 ClaudiuHBann

@ClaudiuHBann Unfortunately, I don't have a Windows device. Could you check iOS or Android, please?

bohdanprog avatar Jul 31 '25 16:07 bohdanprog

@bohdanprog I just tested on my Android device and it works great, I guess on iOS works as well, but on Windows remains the same, anyway LGTM! 😄

ClaudiuHBann avatar Jul 31 '25 17:07 ClaudiuHBann

@ClaudiuHBann Well, maybe you should recompile the Windows source of SVG? I'm not familiar with Windows :( But we could try to find a way to solve that on Windows, too.

bohdanprog avatar Jul 31 '25 17:07 bohdanprog

@ClaudiuHBann, please try to apply the patch and check if it solves the problem. my_custom_patch_file.patch updated.

bohdanprog avatar Jul 31 '25 17:07 bohdanprog