diff --git a/app/assets/javascripts/discourse/app/lib/safari-hacks.js b/app/assets/javascripts/discourse/app/lib/safari-hacks.js index 70c3cadf4d8..c364674f36e 100644 --- a/app/assets/javascripts/discourse/app/lib/safari-hacks.js +++ b/app/assets/javascripts/discourse/app/lib/safari-hacks.js @@ -99,7 +99,6 @@ function positioningWorkaround($fixedElement) { positioningWorkaround.blur = function(evt) { if (workaroundActive) { $("body").removeClass("ios-safari-composer-hacks"); - window.scrollTo(0, originalScrollTop); if (evt && evt.target) { @@ -126,7 +125,8 @@ function positioningWorkaround($fixedElement) { // - invoking a select-kit dropdown // - invoking mentions // - invoking emoji dropdown via : and hitting return - // - invoking a toolbar button + // - invoking a button in the editor toolbar + // - tapping on emoji in the emoji modal if ( lastTouchedElement && @@ -136,9 +136,8 @@ function positioningWorkaround($fixedElement) { $(lastTouchedElement).closest(".autocomplete").length || (lastTouchedElement.nodeName.toLowerCase() === "textarea" && document.activeElement === lastTouchedElement) || - ["span", "svg", "button"].includes( - lastTouchedElement.nodeName.toLowerCase() - )) + $(lastTouchedElement).closest(".d-editor-button-bar").length || + $(lastTouchedElement).hasClass("emoji")) ) { return; }