Topic: Wysiwyg
                  
                  japan
                  priority
                  asked 2 years ago
                
Wysiwyg editor in MDBReact doesn't have any ID, Key, Value, OnChange etc. How can I use it?
                      
                      Mateusz Lazaru
                      staff
                        answered 2 years 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 priority commented 2 years 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
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
 - 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