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

white-space and justify align #2359

Closed
j-san opened this issue Nov 1, 2018 · 4 comments
Closed

white-space and justify align #2359

j-san opened this issue Nov 1, 2018 · 4 comments

Comments

@j-san
Copy link

j-san commented Nov 1, 2018

Do you want to request a feature or report a bug?

feature

What's the current behavior?

When using css text-align: justify; in the editor, text is not justified.

What's the expected behavior?

The text is justified as expected.

On the editor node there is an inline white-space: pre-wrap and this looks like prevent justify to works correctly. using white-space: pre-line looks to solve the issue.

@isubasti
Copy link
Contributor

isubasti commented Nov 1, 2018

@j-san white-space style is overwritable by giving style={{whiteSpace: "pre-line"}} as the editor props. Although, if I remember correctly there are some problems with white-space: pre-line on some browsers as well, so I remove justify content option on the project that I'm working on.

@isubasti
Copy link
Contributor

@j-san now I remember which browser has the problem with pre-line. It's safari, you cannot have a white space at the very end of the block. Space is actually added but the selection can go past the last white space. @ianstormtaylor, do you have any idea why?.

@j-san
Copy link
Author

j-san commented Nov 17, 2018

Yes, it's also what i figured out. My solution is to keep slate behaviour (with white-space: pre-wrap) and add white-space: pre-line on justified text only.

Thanks !

@darshanshah
Copy link

but you cannot add spaces to the justified white-space: pre-wrap conent.
can only add one space max in firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants