Skip to content

Commit 35c22b7

Browse files
authored
feat(editor): Added a new optional textDirection property to config to set the 'dir' attribute on the editor div (#592)
feat(config): add textDirection option for RTL/LTR support - Add textDirection property to AngularEditorConfig - Bind to HTML dir attribute on editor element - Supports 'ltr', 'rtl', and 'auto' values Closes #520
1 parent 4fa6521 commit 35c22b7

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

projects/angular-editor-app/src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export class AppComponent implements OnInit {
5050
],
5151
toolbarHiddenButtons: [
5252
['bold', 'italic'],
53-
]
53+
],
54+
textDirection: 'auto'
5455
};
5556

5657
config2: AngularEditorConfig = {

projects/angular-editor/src/lib/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface AngularEditorConfig {
3838
outline?: boolean;
3939
toolbarHiddenButtons?: string[][];
4040
rawPaste?: boolean;
41+
textDirection?: 'ltr' | 'rtl' | 'auto';
4142
}
4243

4344
export const angularEditorConfig: AngularEditorConfig = {

projects/angular-editor/src/lib/editor/angular-editor.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
[attr.tabindex]="disabled ? -1 : tabIndex"
3939
[attr.translate]="config.translate"
4040
[attr.spellcheck]="config.spellcheck"
41+
[attr.dir]="config.textDirection"
4142
[style.height]="config.height"
4243
[style.minHeight]="config.minHeight"
4344
[style.maxHeight]="config.maxHeight"

0 commit comments

Comments
 (0)