Misaligned caret in Safari 13+ using the invisible space
authorAlexander Ebert <ebert@woltlab.com>
Mon, 20 Jan 2020 18:36:19 +0000 (19:36 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 20 Jan 2020 18:36:19 +0000 (19:36 +0100)
com.woltlab.wcf/templates/wysiwyg.tpl

index 394a223ce3646b9efe7fea44e4ab82006548cde8..85546348908ce1a3c83b4ccf2f8a72b88fae5fa1 100644 (file)
                                }
                        };
                        
+                       // The caret is misaligned in Safari 13+ when using \u200b. 
+                       if (Environment.browser() === 'safari') {
+                               config.emptyHtml = '<p><br></p>';
+                       }
+                       
                        // user mentions
                        if (elDataBool(element, 'support-mention')) {
                                config.plugins.push('WoltLabMention');
                        config.callbacks.init = function() {
                                // slight delay to allow Redactor to initialize itself
                                window.setTimeout(function() {
-                                       if (content === '' && Environment.platform() === 'ios') {
+                                       if (content === '' && (Environment.platform() === 'ios' || Environment.browser() === 'safari')) {
                                                content = '<p><br></p>';
                                        }