Wysiwyg

japan pro premium priority asked a year ago

Wysiwyg editor in MDBReact doesn't have any ID, Key, Value, OnChange etc. How can I use it?


mlazaru staff answered a year ago

It should have a onChange event to return formatted code, because at the moment there is no good, 'reactive' way to use the component. We will add this feature soon.

I've prepared a temporary workaround solution for you:

<form
  onSubmit={(e) => {
    e.preventDefault();
    const wysiwyg = document.querySelector('.my-wysiwyg .wysiwyg-content');
    console.log(wysiwyg?.innerHTML);
  }}
>
  <MDBWysiwyg className='my-wysiwyg'></MDBWysiwyg>
  <button type='submit' className='btn btn-primary'>
    Submit
  </button>
</form>

japan pro premium priority commented a year ago

Thanks, it's good for simple form, but if we need set required, allow save form only on change, validation input, it is insufficient. I hope, that update will be soon


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 6.1.0
  • Device: PC
  • Browser: Chrome
  • OS: Win10
  • Provided sample code: No
  • Provided link: No
Tags