0

[code snippet][1][enter image description here][2]This is the problem I am facing

I am facing one problem in my project where I used Tinymce's RTE, but when I write anything on it, it displays the text backwards on RTE, Is there any problem in default system that it write text from right to left instead of left to right?

import React from 'react'
import { Controller } from 'react-hook-form'
import {Editor} from '@tinymce/tinymce-react'
export default function RTE({name, control,label, defaultValue = ""}) {
  return (
    <div className='w-full'>
    {label && <label className='inline-block mb-1 pl-1 '>{label}</label>}
    <Controller
    name = {name || "content"}
    control = {control}
    render ={({field : {onChange}})=>{
       return <Editor
       apiKey='ba5uegymspq869k9ppqqmy7iyrv0x343usoozmiybsy4folu'
        initialValue={defaultValue}
        init={{
            initialValue: defaultValue,
            height: 500,
            menubar: true,
            plugins: [
                "image",
                "advlist",
                "autolink",
                "lists",
                "link",
                "image",
                "charmap",
                "preview",
                "anchor",
                "searchreplace",
                "visualblocks",
                "code",
                "fullscreen",
                "insertdatetime",
                "media",
                "table",
                "code",
                "help",
                "wordcount",
                "anchor",
            ],
            toolbar:
            "undo redo | blocks | image | bold italic forecolor | alignleft aligncenter bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |removeformat | help",
            content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
        }}
        onEditorChange={onChange}
        />
    }}
    />
    </div>
  )
}


  [1]: https://i.sstatic.net/UfJF2ZED.png
  [2]: https://i.sstatic.net/gYLGGtmI.png
7
  • please share the code snippet how you implemented the text editor. i had similar issue in the past, it was due to the way i was passing the value to the rich editor (but i was using quill) wihtout a code snippet no one will be able to help you.
    – Elna Haim
    Commented May 23 at 14:22
  • code snippet added Commented May 24 at 15:10
  • 1
    .ǝɯ oʇ ǝuıɟ sɯǝǝS Commented May 24 at 15:15
  • The code is NOT considered added if its in a picture, as if you want help, devs need a way to copy and paste the code, and having to retype it perfectly from an image is taxing and not supported as a question for this website. Update when time permits. Commented May 24 at 16:29
  • 1
    now i have added the original code snippet you can check it here Commented May 25 at 16:56

0

Browse other questions tagged or ask your own question.