marmelab / aor-rich-text-input

<RichTextInput> component for admin-on-rest, useful for editing HTML code in admin GUIs
MIT License
23 stars 25 forks source link

How to set default direction on RTL in RichTextInput #18

Open alihesari opened 6 years ago

alihesari commented 6 years ago

I'm using the Admin-on-rest framework. I read AOS and Quill documents and don't find any solution. How to set default direction on RTL in RichTextInput? I want to it always be right-to-left.

    export const BookCreate = (props) => (
        <Create {...props} title="ایجاد کتاب جدید">
            <SimpleForm>
                <TextInput label="عنوان کتاب" source="title" />
                <RichTextInput label="توضیحات" source="description" formats={[{direction:'rtl'}]} toolbar={[ 
                    ['bold', 'italic', 'underline', 'link'],
                    [{ 'direction': 'rtl' }],
                    [{ 'align': [] }],
                    ['clean'],
                    [{ 'list': 'ordered'}, { 'list': 'bullet' }],
                ]} />
            </SimpleForm>
        </Create>
    );