Skip to content

Commit

Permalink
adds RTL text direction support to DraftWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Mar 8, 2023
1 parent 26019b6 commit a4ced4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cms/src/components/editors/DraftWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ class DraftWrapper extends Component {
const MentionSuggestionsFormatter = this.mentionPluginFormatter.MentionSuggestions;
const MentionSuggestionsSelector = this.mentionPluginSelector.MentionSuggestions;
const plugins = [
this.mentionPlugin,
this.mentionPluginFormatter,
this.mentionPluginSelector,
this.mentionPlugin,
this.mentionPluginFormatter,
this.mentionPluginSelector,
this.staticToolbarPlugin,
this.customLinkifyPlugin
];
Expand All @@ -169,7 +169,7 @@ class DraftWrapper extends Component {
const {showToolbar} = this.props;

return (
<div className="cms-draft-wrapper" onClick={this.focus}>
<div className="cms-draft-wrapper" onClick={this.focus} dir={this.props.dir || "ltr"}>
{/* main editor */}
{showToolbar && <Toolbar>
{
Expand All @@ -194,7 +194,7 @@ class DraftWrapper extends Component {
ref={c => this.editor = c}
key="draft-editor"
/>


{/* variables dropdown (generators, materializers) */}
<span className="cms-draft-entry cms-variable-draft-entry">
Expand Down
1 change: 1 addition & 0 deletions packages/cms/src/components/editors/RichTextEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class RichTextEditor extends Component {
</label>
<DraftWrapper
id={f}
dir={["ar", "he"].includes(locale) ? "rtl" : "ltr"}
key="dw"
selectors={selectors}
formatters={formatters}
Expand Down

0 comments on commit a4ced4d

Please sign in to comment.