Topic: WYSIWYG Editor saving problem suggestion
Topcathk free asked 5 years ago
Currently the editor fail to record the last typed character and style change(bolding words, changing text color etc.) if no key is pressed afterwards.
Here is the way to reproduce the result:
<textarea id="example"> </textarea>
<button type="button" id="btn" class="btn btn-primary btn-sm">Save</button>
<script>
$('#example').mdbWYSIWYG();
$('#btn').on('click', () => {alert($('#example').val());});
</script>
Post from the past ( https://mdbootstrap.com/support/other/mdb-wysiwyg-last-character-is-lost/ ), mentioned that the problem is due the wrong event ''keypress" is used (which is still not fixed)
$("#wysiwyg-".concat(this.uuid)).on('keypress', this.updateNativeTextarea.bind(this));
However even if I follow the solution, the problem is still not solved (changing the event from 'keypress' to 'keydown'). And I found a temporary solution, to change the event from 'keypress' to 'input'. The editor is working as intended.
$("#wysiwyg-".concat(this.uuid)).on('input', this.updateNativeTextarea.bind(this));
MDB Team please fix the issues ASAP as this has been left for quite a long time.
paulrhanson free answered 4 years ago
Hello,
I just downloaded WYSIWYG version 4.8.11 and this problem still exists. Has it been fixed? Or, am I just missing something?
Thank you!
- Paul
Grzegorz Bujański staff commented 4 years ago
Hi. I see that the problem still exists. I will add this to our to-do list and we check why it is happening
MDBootstrap staff answered 5 years ago
Hi Topcathk,
Thank you for reminding us about this issue. Your solution seems to fix this problem, so we will test it further. I added this problem to our to-do list and we will try to implement it may be in the next release cycle.
If you need additional help, I am here for you.
Best Regards, Piotr
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.2
- Device: Desktop
- Browser: Chrome
- OS: Win 10
- Provided sample code: No
- Provided link: Yes