Conversation
browser/components/CodeEditor.js
Outdated
| inputStyle: 'textarea', | ||
| dragDrop: false, | ||
| direction: RTL ? 'rtl' : 'ltr', | ||
| rtlMoveVisually: RTL ? 'true' : 'false', |
There was a problem hiding this comment.
Why don't you just write RTL instead of RTL ? 'true' : 'false'
browser/components/CodeEditor.js
Outdated
| } | ||
| if (prevProps.RTL !== this.props.RTL) { | ||
| this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr') | ||
| this.editor.setOption('rtlMoveVisually', this.props.RTL ? 'true' : 'false') |
There was a problem hiding this comment.
Can you write this.props.RTL instead of this.props.RTL ? 'true' : 'false' please?
| ${RTL ? 'direction: rtl;' : ''} | ||
| ${RTL ? 'text-align: right;' : ''} | ||
|
|
||
|
|
There was a problem hiding this comment.
Please remove these 2 empty lines
| onClick, editorDirection | ||
| }) => ( | ||
| <div styleName='control-toggleModeButton'> | ||
| <div styleName={editorDirection ? 'active' : undefined} onClick={() => onClick()}> |
There was a problem hiding this comment.
editorDirection is quite hard to understand, can you assign it to a more meaningful variable name such as isRTL or something?
|
@ibraude ping! |
|
@ZeroX-DG Sorry for the delay |
|
@ibraude can you fix the conflict before I officially approve it? |
ZeroX-DG
left a comment
There was a problem hiding this comment.
Sorry for the late response. I found some bug when I test it again, can you fix it please?
| box-sizing: border-box; | ||
| ` | ||
| : ''} | ||
| ${optimizeOverflowScroll ? 'height: 100%;' : ''} |
There was a problem hiding this comment.
This optimizeOverflowScroll variable is undefined can you fix it please
Description
I have added a direction toggle switch for the MarkdownPreview and CodeEditor. (It's located at the top right, next to the Toggle Mode switch button)
This is so notes can be taken and read comfortably when using right-to-left languages like Hebrew or Arabic.
Here is the Boostnote welcome page in the LTR direction:

Here is the Boostnote welcome page in Hebrew with the RTL direction:

I have also added a hotkey for direction toggle:

Issue fixed
This fixes the open issue "Please add RTL support" #846
I believe this is a simple solution that answers the need for people using both ltr and rtl languages regularly.
Type of changes
Checklist:
All tests pass except for the test:
tests/lib/markdown-toc-generator-test.jsI think that the test throws an error because it recognizes the difference between the rtl to ltr as seen in the image below when infact it is the desired result.
Hope this helps.
Cheers