Set default direction to RTL

See original GitHub issue

I think it’s better to have an option to set default direction of editor to RTL.

In websites that have only one RTL language, Users dont want to click on RTL button everytime they start typing on editor and it has a bad sense because website is RTL and editor should be RTL.

Also I saw the generated code of editor and it set’s a class for every node (ql-align-right ql-direction-rtl), this causes adding unneeded classes to text.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:31
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

57reactions
tegolacommented, Jan 25, 2018

I think it’s better to have an option to set default direction of editor to RTL.

This would be handy, but you can do the same by initializing the editor and set the text direction and alignment:

var node = document.getElementById('editor');
var editor = new Quill(node, { theme: 'snow' });

editor.format('direction', 'rtl');
editor.format('align', 'right');

Also I saw the generated code of editor and it set’s a class for every node (ql-align-right ql-direction-rtl), this causes adding unneeded classes to text.

Quill works with the Delta format, which can be read back and formatted as you wish. It is not supposed to output compatible html. If you need to tweak html output, you need to tinker with Parchment. See some examples here.

6reactions
ali-hasanicommented, Nov 5, 2018
.ql-editor {
  direction: rtl;
  text-align: right;
}

we want to make it rtl initially and also make it selectable (changeable), but with your idea it will be locked in rtl direction and the direction option in toolbar will be useless …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting default direction to RTL - tinymce
I install Tinymce editor to my site. And now i need to set the default direction to RTL not LTR.
Read more >
direction - CSS: Cascading Style Sheets - MDN Web Docs
The direction CSS property sets the direction of text, ... Text and other elements go from left to right. This is the default...
Read more >
direction
ltr – Left to Right, the default; rtl – Right to Left; inherit – inherits its value from the parent element. The text...
Read more >
Change default text direction in Skype (rtl)
I use Hebrew language, and need the default setting for text direction to be right-to-left. I saw in this article, that there is...
Read more >
Nebular - Right-to-left (RTL) - GitHub Pages
All Nebular components support RTL out of the box. ... Document direction could be set through the NbThemeModule.forRoot call. Supported values are ltr...
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