Inline `<a>` tag taking full horizontal width on Web.
See original GitHub issueDecision Table
- My issue does not look like “The HTML attribute ‘xxx’ is ignored” (unless we claim support for it)
- My issue does not look like “The HTML element
<yyy>
is not rendered”
Good Faith Declaration
- I have read the HELP document here: https://git.io/JBi6R
- I have read the CONTRIBUTING document here: https://git.io/JJ0Pg
- I have confirmed that this bug has not been reported yet
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
System:
OS: Linux 5.10 Manjaro Linux
CPU: (16) x64 Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz
Memory: 363.11 MB / 15.47 GB
Shell: 5.1.8 - /bin/bash
Binaries:
Node: 14.16.0 - /usr/bin/node
Yarn: Not Found
npm: 6.14.13 - ~/.npm-globals/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 29, 30
Build Tools: 29.0.2, 29.0.3, 30.0.3
System Images: android-29 | Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: 4.13.1 => 4.13.1
react: ^17.0.2 => 17.0.2
react-native: 0.64.1 => 0.64.1
npmGlobalPackages:
*react-native*: Not Found
RNRH Version
V6.0.0-beta.8
Tested Platforms
- Android
- iOS
- Web
- MacOS
- Windows
Reproduction Platforms
- Android
- iOS
- Web
- MacOS
- Windows
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
<html-node>
<body-node>
<code-node>
previously
<html-node>
<body-node>
<wrapper-node>
<code-node>
Issue Analytics
- State:
- Created 2 years ago
- Comments:18
Top Results From Across the Web
inline-size - CSS: Cascading Style Sheets - MDN Web Docs
The inline-size CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode.
Read more >How to spread elements horizontally evenly? - Stack Overflow
Since you're dealing with inline-block, you can't have spaces between the tags (ugly, but it works), otherwise the space will be visible.
Read more >How to Make Inline-Block Elements Add Up to 100% Width
You have two divs that are displayed inline-block. You set the width of each div to exactly 50%, but the second div falls...
Read more >CSS Layout - display: inline-block - W3Schools
Compared to display: inline , the major difference is that display: inline-block allows to set a width and height on the element.
Read more >Exploring the Complexities of Width and Height in CSS
An inline element is an element that's width and height are determined by the content it contains. Inline elements, such as a <span>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here it is: https://github.com/meliorence/react-native-render-html/commit/dad450db8d79c85ba8ab4a8d585d889d033d2234 If you have any “lively” question, ping me in our Discord!
PS: a better name for the prop:
preserveAnonymousTPhrasingNodes
and a description:Another side-effect of that change. Check out the first
Inline code block
behaving like a code block on Web.