How to exit blockquote block or div
Steps to reproduce:
- Clicking blockquote icon
- Insert the content
- No way to move the cursor to go out of
<blockquote></blockquote>
it's the same issue if I change <blockquote></blockquote> to <div></div>
But for <table></table> or <a></a>, I can use left arrow or right arrow to exit the table block
please try: https://codepen.io/hoangnt142/pen/GGKBMw
many thanks!!
I resolved this problem by using this config we need to press ESC button to exit
init_instance_callback: function (editor) {
editor.on('KeyDown', function (e) {
if(e.keyCode == 27) {
let editor = tinyMCE.activeEditor
const dom = editor.dom
const parentBlock = tinyMCE.activeEditor.selection.getSelectedBlocks()[0]
const containerBlock = parentBlock.parentNode.nodeName == 'BODY' ? dom.getParent(parentBlock, dom.isBlock) : dom.getParent(parentBlock.parentNode, dom.isBlock)
let newBlock = tinyMCE.activeEditor.dom.create('p')
newBlock.innerHTML = '<br data-mce-bogus="1">';
dom.insertAfter(newBlock, containerBlock)
let rng = dom.createRng();
newBlock.normalize();
rng.setStart(newBlock, 0);
rng.setEnd(newBlock, 0);
editor.selection.setRng(rng);
}
});
},
Same problem, nguyenkiidu's config work like a charm.
Many thanks
Hi, nguyenkiidu. I think I have similar problem, because its not possible exit from DVI in WYSIWYG mode in TinyMCE with enter, ctrl+enter, keyboard arrow or anything else. Only solution is switch to code and add new content after
Can you or somebody else please answer where this fixing code supposed to go? I'm using Tinymce in Joomla.
@AkiraErebos
hi, you can add it inside tinymce.init
this is an example
https://gist.github.com/nguyenkiidu/c102065f2c475d18521ebf14d168498b
This issue has been closed due to inactivity. Tiny will soon be working with members of the community to close other old issues on our GitHub repositories. There are some excellent discussions and reports in the main TinyMCE GitHub repository, but with so many open issues, we cannot monitor them all. Reviewing all of the issues individually would be an enormous task, requiring time that could be better spent developing new features and fixing bugs. Therefore, we are closing issues that have been inactive for over 365 days, with some exceptions. If this issue is still relevant, please re-open this issue or create a new one. If you have any questions or concerns, you can contact me at [email protected]. You can also join the discussion on our mailing list at the following link: [email protected].
This problem still exist. The configuration suggested by nguyenkiidu works but cannot work for mobile users.
Actually instagram's embed use blockquote so users can't get out of instagram blockquote.
Is there anyways to help ?
edit: The only solution I found is to force wrap the blockquote with a paragraphe tag <p><blockquote></blockquote></p>
I resolved this problem by using this config we need to press ESC button to exit
init_instance_callback: function (editor) { editor.on('KeyDown', function (e) { if(e.keyCode == 27) { let editor = tinyMCE.activeEditor const dom = editor.dom const parentBlock = tinyMCE.activeEditor.selection.getSelectedBlocks()[0] const containerBlock = parentBlock.parentNode.nodeName == 'BODY' ? dom.getParent(parentBlock, dom.isBlock) : dom.getParent(parentBlock.parentNode, dom.isBlock) let newBlock = tinyMCE.activeEditor.dom.create('p') newBlock.innerHTML = '<br data-mce-bogus="1">'; dom.insertAfter(newBlock, containerBlock) let rng = dom.createRng(); newBlock.normalize(); rng.setStart(newBlock, 0); rng.setEnd(newBlock, 0); editor.selection.setRng(rng); } }); },
This helped me for sure. Cool workaround.