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

Subscript elements should be bottom aligned #259

Closed
jamesovens opened this issue Apr 24, 2019 · 6 comments
Closed

Subscript elements should be bottom aligned #259

jamesovens opened this issue Apr 24, 2019 · 6 comments
Labels
bug:upstream The bug is caused by a third party library. bug Crush'em all.

Comments

@jamesovens
Copy link

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.

@shift2androidios
Copy link

shift2androidios commented Aug 8, 2019

Hi

sup tag align text to bottom , sub is working fine now.

can you please help me with this ?

@muskanaul
Copy link

Hey, sup or sub is not working for me. Were you able to do this with a custom renderer/styling?

@jamesovens
Copy link
Author

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.

@jsamr jsamr added the bug Crush'em all. label Jul 4, 2020
@jsamr

This comment has been minimized.

@jsamr jsamr added the is:waiting for feedback Waiting for OP input. label Jul 5, 2020
@jsamr jsamr added bug:easyfix Easily fixed. and removed is:waiting for feedback Waiting for OP input. labels Jul 19, 2020
@jsamr jsamr removed the bug:easyfix Easily fixed. label Jul 20, 2020
jsamr added a commit that referenced this issue Jul 20, 2020
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
@jsamr jsamr added the bug:upstream The bug is caused by a third party library. label Jul 20, 2020
@jsamr
Copy link
Collaborator

jsamr commented Jul 20, 2020

I'm closing in favor of #76.
@jamesovens in response to what you suggested, see this commit message: 002b7fb

@jsamr jsamr closed this as completed Jul 20, 2020
@jsamr
Copy link
Collaborator

jsamr commented Jul 20, 2020

If you want this feature, upvote it here: https://react-native.canny.io/feature-requests/p/support-superscript-and-subscript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:upstream The bug is caused by a third party library. bug Crush'em all.
Projects
None yet
Development

No branches or pull requests

4 participants