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.

setDefaultStyle It works very badly in Text-Align

See original GitHub issue

@JiHong88 hi By default, the Text-Align is left to right, and in this case everything works fine. But I used the following method to make the Text-Align , right to left by default

editor.setDefaultStyle("font-family: Vazir; font-size: 18px;text-align:right;direction:rtl");

But in this case, the text inside the editor is displayed from right to left, but when I display the text on my page, the text is from left to right. It seems that this method did not work

When I looked more closely, I realized that this method gives the styles to the editor itself, not to the text inside it.

How can we give default values to tools such as Text-Align, font, font size, direction, etc.? And apply to all texts entered in the editor.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Saeeed-Bcommented, Nov 15, 2020

@JiHong88 Thank you again. Certainly your editor is the best for me, who has been looking for a good editor for years. And I’m waiting for these examples

0reactions
sdraper69commented, Aug 11, 2021

Just to confirm if I am seeing the same issue, if you set the default style to text-align: center, you can then never get a piece of text in the editor to be left-aligned - is this the same issue or should I open a new one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

setDefaultStyle It works very badly in Text-Align #563 - GitHub
When I looked more closely, I realized that this method gives the styles to the editor itself, not to the text inside it....
Read more >
CSS text-align does not work - Stack Overflow
The text-align property does work in your example. It's just that the text is aligned regarding it's container. Which in this case is...
Read more >
10 Bad Typography Habits that Scream Amateur | by Meetchopz
10 Bad Typography Habits that Scream Amateur · 1. Center-aligning paragraphs of text · 2. Too much or too little leading · 3....
Read more >
style="text-align:center" vs align="center" vs <center>
I know of three different methods to align text in html. 1. ` text ` 2. ` text ` 3. ` text `...
Read more >
text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the ... This means it works like vertical-align but in the horizontal ...
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