Partial fix Can't start a new reply with a smilie after using Quick Reply

jwjwjw

Member
This bug seems to affect Safari and Chrome. I don't have access to IE/Edge to test, but it isn't reproducible in Firefox.

If you start a new Quick Reply by clicking the smilie button and then picking a smilie from the list, it works fine for the first time. But once you've posted your reply, if you try to start another new Quick Reply with a smilie in the same post without refreshing, although you can click the smilie button to see the list of smilies, nothing happens if you then click a smilie from the list - it's not inserted.

You have to type some text in the box before you are able to insert a smilie when composing your second (or third, etc) Quick Reply in the same post, unless you refresh the page. I'm assuming this is a bug because you don't have to type some text in the box before you are able to insert a smilie when you're making your first reply.
 
This seems like more of a Chrome/Webkit bug regarding it not focusing as normal, despite the calls to do it. I have managed to prevent the error that was blocking the smilie insert, though it does insert after the blank line at the start. (This is due to where Chrome thinks the selection is, which is actually after the first line.)
 
This seems like more of a Chrome/Webkit bug regarding it not focusing as normal, despite the calls to do it. I have managed to prevent the error that was blocking the smilie insert, though it does insert after the blank line at the start. (This is due to where Chrome thinks the selection is, which is actually after the first line.)
Hi Mike,

Good to hear there's a partial fix. I worked out that if you toggle the BB Code editor and then go back to the rich text editor after posting a Quick Reply, Chrome behaves normally.

So as a workaround (which seems to insert at the right place in Chrome), I'm programmatically toggling between the BB Code editor and then going back to the rich text editor after a Quick Reply has been posted. This jQuery code seems to work (with a fadeout to hide the quick change):

Code:
jQuery(".redactor_box").fadeOut(function() {
            jQuery(".redactor_btn_switchmode").click();
            setTimeout(function() {
                jQuery(".bbCodeEditorContainer a").click();
            }, 0);
            jQuery(".redactor_box").fadeIn();
        });

It's almost certainly not production-grade code, but it does fully fix the issue for me.
 
Top Bottom