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](https://user-images.githubusercontent.com/1051164/148482119-550d922e-eb3f-443e-a427-f554ee2105b2.png)
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.0react
version: 17.0.2- Browser: Chrome
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
@gnapse I did! Although I just created the PR for it now
@pauloslund did you end up doing something about this?