Skip to content

Commit 515529c

Browse files
authored
UX: Show fast edit at top of window on mobile (discourse#21590)
1 parent 082821c commit 515529c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/assets/javascripts/discourse/app/components/quote-button.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,10 @@ export default Component.extend(KeyEnterEscape, {
378378

379379
schedule("afterRender", () => {
380380
if (this.site.mobileView) {
381-
this.element.style.left = `${
382-
(window.innerWidth - this.element.clientWidth) / 2
383-
}px`;
381+
this.textRange = document.querySelector("#main-outlet");
382+
this._popper?.update();
384383
}
385-
document.querySelector("#fast-edit-input")?.focus();
384+
next(() => document.querySelector("#fast-edit-input")?.focus());
386385
});
387386
} else {
388387
const postId = this.quoteState.postId;

0 commit comments

Comments
 (0)