-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Inline <a>
tag taking full horizontal width on Web.
#514
Comments
@parasharrajat Interesting case; react-native-web seems to set
This change was introduced to lighten the render tree, with the additional benefit of leveraging a couple of bugs with React Native nested |
<code>
block taking full horizontal width on Web.<a>
tag taking full horizontal width on Web.
Thanks @jsamr , I will try that. |
This seems to work fine. Please let me know if you have plans to fix this issue in the core library. I can track this issue and upgrade the lib as soon as it's done. |
@parasharrajat Sure, I'll let you know! |
@parasharrajat is that an effect of |
I think Removal of the wrapper. Inside flex-container inline node is behaving block. I added |
@parasharrajat If you're willing to provide a reproduction for this second issue, I'd be happy to investigate. As per your first issue, I think a better solution would be to only target the See https://snack.expo.dev/@jsamr/rnrh-web-bug Otherwise, unintended side-effect might proof hard to foresee. |
@jsamr Here you go https://snack.expo.dev/@parasaharrajat/rnrh-web-bug. There is another issue that I am facing. Expensify/App#4733. The same code was working previously. |
For now, I suggest that you revert those changes as it causing a lot of issues and then carefully migrate. I would like to keep the latest v6 due to stability and some good feature. |
@parasharrajat I am probably going to provide a 6.0.6-beta.0 with a prop to disable this behavior so that you can quickly provide a "fix", and after that take some time to investigate further the implications of that change. I can't revert the behavior without introducing a breaking change and potentially disrupting many consumers. I must stress that many bugs exist with nested text in React Native and one main reason for this change was to mitigate these whenever possible. I'm pretty busy right now, so expect a beta before the end of the week. If you are willing to, you can also provide a PR (the name of the prop should be |
Thanks for prompt action @jsamr. It sounds great. I will look into the codebase to understand it and try to put up a PR to disable this behaviour behind the flag. Could you please link me to the PR where you made this change or the commit? It would help me quickly get familiar with the main area. |
Here it is: dad450d PS: a better name for the prop: /**
* When `true`, preserve anonymous {@link TPhrasing} nodes parents of lonely {@link TText} nodes at render time instead of bypassing them and rendering their child directly.
*
* @defaultValue `false`
*/ |
@parasharrajat Not sure what is the expected behavior versus what is observed? I can't find anything surprising in this snippet (Web), what did I miss? |
Previously, the second code block used to wrap same as first code block where border and background also wrap with text. It used to behave inline but now it is block. Text is wrapping but border and background is surrounding whole text and its not breaking on each line. |
@parasharrajat Got you, I tried your example with alpha-20: |
@parasharrajat You can now set |
Thanks, I will take a look. |
Decision Table
<yyy>
is not rendered”Good Faith Declaration
Description
In the Older version of RNRH the
<code>
element use to behave inline but now. it takes the full width of the screen.I think this change has affected every tag. For example, if you add a link element, it is clickable from empty space on the web.
In the above image click the far right and it goes to that link on the web.
WEB
Inline Tag expands to the full width of the parent.
React Native Information
RNRH Version
V6.0.0-beta.8
Tested Platforms
Reproduction Platforms
Minimal, Reproducible Example
https://snack.expo.dev/hGHmxvgL7
Additional Notes
I compared the older alpha version of the V6 to the Beta version. There is only one difference that there used to be a wrapping node in DOM around the main tag node but now it's not there. So Body tags
flex:column
styling is causing it to expand to full-width.The structure is like this
previously
The text was updated successfully, but these errors were encountered: