question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Box: Using "start" as a value for textAlign doesn't add text alignment

See original GitHub issue

🐛 Bug report

Current behavior

Using "start" as a value for textAlign prop doesn’t add any text alignment. This means it is impossible to left align content that is nested under a component with a different text alignment.

Steps to reproduce the bug

You can see a reproduction of this issue in this Sandbox https://codesandbox.io/s/ancient-wave-dr52s?file=/src/App.js:205-266. I

CleanShot 2022-01-06 at 19 34 23@2x

Expected behavior

You should be able to left align content, no matter what the parent styles are.

Possible solutions

Currently, the textAlign property defaults to “start”, which ends up being a no-op: https://github.com/Doist/reactist/blob/02bd83ee481b2d91e6047c30f09d9706a03a7e0a/src/new-components/box/box.tsx#L151-L153

I think it would make sense for textAlign to not have a default value, and then make "start" behave the same way as the other values like "center" and "end".

Environment

  • @doist/reactist version: 11.0.0
  • react version: 17.0.2
  • Browser: Chrome

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pauloslundcommented, Jan 31, 2022

@gnapse I did! Although I just created the PR for it now

0reactions
gnapsecommented, Jan 26, 2022

@pauloslund did you end up doing something about this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

text-align
The text-align property in CSS is used for aligning the inner content of a block element.
Read more >
Why doesn't text-align center work? A primer on block and ...
It is a block-level element. To align it, we will have to use something other than text-align , or turn it into an...
Read more >
Text-align isn't working for form element
Text align works only with inline and inline-block elements, so you have to say input and button are inline-blocks. Share.
Read more >
How to Center Text & Headers in CSS Using the Text-Align ...
To center text in CSS, use the text-align property and define it with the value 'center.' You can use this technique inside block...
Read more >
text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found