-
-
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
Subscript elements should be bottom aligned #259
Comments
Hi sup tag align text to bottom , sub is working fine now. can you please help me with this ? |
Hey, sup or sub is not working for me. Were you able to do this with a custom renderer/styling? |
So I managed to use a custom renderer for both sub and sup and managed to set it so that sup received textAlignVertical: "top" and also display: "inline-block" for web but display: "flex" for native (as I'm working on a React Native Web project), and for sub it was textAlignVertical: "bottom" Unfortunately textAlignVertical is an android only property, and not sure about what the plans are for it in the future for both Android and iOS. |
This comment has been minimized.
This comment has been minimized.
textAlignVertical doesn't work relatevely to line, but to containing block. Those styles gave the false impression that sub and sup where fully supported, but that will not be the case until React Native has official support for this. Vote for the feature here: https://react-native.canny.io/feature-requests/p/support-superscript-and-subscript Related #259, #76
I'm closing in favor of #76. |
If you want this feature, upvote it here: https://react-native.canny.io/feature-requests/p/support-superscript-and-subscript |
Is this a bug report or a feature request?
Bug Report
Have you read the guidelines regarding bug report?
Yes
Have you read the documentation in its entirety?
Yes
Have you made sure that your issue hasn't already been reported/solved?
Yes
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
Reproducible on all platforms
Is the bug reproductible in a production environment (not a debug one)?
Yes
Have you been able to reproduce the bug in the provided example?
Yes
Environment
The bug is environment independent
Steps to Reproduce
Attempt to render a subscript element e.g.
<p>N<sub>2</sub></p>
Expected Behavior
You should see the text that is within the subscript element is vertically aligned to the bottom, e.g. it should look like:
N2
Actual Behavior
The text that is within the subscript element is vertically aligned to the top, e.g. it currently looks like:
N2
We can see that that
<sub>
elements are given vertical alignment to top here:https://github.com/archriss/react-native-render-html/blob/master/src/HTMLDefaultStyles.js#L47
when it just needs to be bottom.
The text was updated successfully, but these errors were encountered: