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

SVG children view with width style in percentage stopped working in 15.11.1 #2610

Open
zarv1k opened this issue Jan 14, 2025 · 3 comments · May be fixed by #2612
Open

SVG children view with width style in percentage stopped working in 15.11.1 #2610

zarv1k opened this issue Jan 14, 2025 · 3 comments · May be fixed by #2612

Comments

@zarv1k
Copy link

zarv1k commented Jan 14, 2025

Description

SVG children view that has width style in percentage dimensions stopped working in [email protected] on both iOS and Android in the latest [email protected] (new arch, bridgeless mode):

Screen.Recording.2025-01-14.at.12.42.54.mov

Expecting that the children view of SVG has full width of parent SVG view while width=100% style applied.
Actually the width style of children SVG view is not applied and the centered text is hidden.

Please see reproducer (main branch).


It works fine in previous version [email protected] (rnsvg15.10.1 branch in reproducer repo):

Screen.Recording.2025-01-14.at.12.31.51.mov

Steps to reproduce

  1. Open reproducer
  2. Turn switch on & off that toggles style (width=100% and window.width as number) to the SVG's children view

Snack or a link to a repository

https://github.com/zarv1k/SvgChildrenWidth100pctIssue

SVG version

15.11.1

React Native version

0.76.6

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

any iOS and Android device

Acknowledgements

Yes

@zarv1k
Copy link
Author

zarv1k commented Jan 14, 2025

Looks like it's similar to #2519. Tried the workaround (#2519 (comment)) but it does not work.

@zarv1k zarv1k changed the title SVG children view with width style in percentage does not work SVG children view with width style in percentage stopped working in 15.11.1 Jan 14, 2025
@jakex7 jakex7 linked a pull request Jan 14, 2025 that will close this issue
@jakex7
Copy link
Member

jakex7 commented Jan 15, 2025

Hey @zarv1k, thanks for sharing that.
I've created PR #2612, which should resolve your issue. Could you test it and let me know if it works for you?

@zarv1k
Copy link
Author

zarv1k commented Jan 16, 2025

@jakex7, I just checked and can confirm that your PR fixes the subject issue! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants