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

[Text] Add support for vertical-align style property #1774

Closed
fatuhoku opened this issue Jun 28, 2015 · 14 comments
Closed

[Text] Add support for vertical-align style property #1774

fatuhoku opened this issue Jun 28, 2015 · 14 comments
Labels
Resolution: Locked This issue was locked by the bot. Type: Enhancement A new feature or enhancement of an existing feature.

Comments

@fatuhoku
Copy link

I've marked the line rectangle with faint red:

ios simulator screen shot 28 jun 2015 21 32 30

The text is sitting on the bottom of that rectangle. i.e. it's anchored to the bottom.

I was expecting the line spacing to be below the text, i.e. text should be anchored to the top of the line rectangle.

When will support of this come?

@brentvatne brentvatne changed the title lineHeight anchors text to bottom of the line, but I really want it to anchor to the top [Text] lineHeight anchors text to bottom of the line, but I really want it to anchor to the top Jun 30, 2015
@MossP
Copy link

MossP commented Jul 20, 2015

Not a perfect solution and I'm not sure if it's going to be implemented but could you not offset the <Text/> element inside a view and negative margin that to compensate for the difference? You would need to add overflow:'hidden' to the outer element too if you cannot have any invisible overlapping elements.

e.g. https://rnplay.org/apps/MKdiOw

@fatuhoku
Copy link
Author

@MossP Hmmm!! That's good thinking. It's a possible solution for sure, and seems watertight. I'll give that a try soon...

@MossP
Copy link

MossP commented Jul 20, 2015

Hope it goes well :)

I'll get this closed for now and if you're still having problems give me a shout and we'll look at re-opening it.

One to close for now @brentvatne, thanks.

@brentvatne
Copy link
Collaborator

This seems like a reasonable request - support for vertical-align, or at least some subset of it, would be a valuable addition to the core. cc @vjeux

@brentvatne brentvatne changed the title [Text] lineHeight anchors text to bottom of the line, but I really want it to anchor to the top [Text] Add support for vertical-align style property Jul 20, 2015
@coyer
Copy link

coyer commented Dec 25, 2015

I have this problem too. on IOS, text is bottom align and on Android, text at the top position of rect. how do I ?

@guyca
Copy link

guyca commented Feb 13, 2016

Aligning text is pretty annoying right now and requires way too much work. Is the only way to align text today is to wrap the element inside some container and align the whole View inside the wrapping container ?

@cpjolicoeur
Copy link

Doesn't flexbox already handle this via flexDirection and alignItems combo?

@aboutqx
Copy link

aboutqx commented Apr 16, 2016

@cpjolicoeur it seems not working.

@fatuhoku
Copy link
Author

fatuhoku commented Apr 20, 2016

@cpjolicoeur flexDirection and alignItems might be a good hack for single line Text elements, but vertical-align is necessary when you're working with multiline Text elements.

@aboutqx
Copy link

aboutqx commented Apr 21, 2016

@fatuhoku That's is right,when you want 2 or more lines to be in vectical center,you need to add a container to wrapp them.

@mkonicek
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/text-add-support-for-vertical-align-style-property

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless
Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

@ghost
Copy link

ghost commented Jun 29, 2017

this feature is now available or not ?

@AdriaRios
Copy link

Any updates?

@Athaphian
Copy link

No it is not available. Even in late 2017 creating a simple superscript in React Native seems an impossible task.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
@hramos hramos added the Type: Enhancement A new feature or enhancement of an existing feature. label Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests