another tweak

This commit is contained in:
Penar Musaraj 2024-12-13 11:39:56 -05:00
parent a3f0d08e1a
commit 46c72c1200
2 changed files with 17 additions and 3 deletions

View File

@ -209,6 +209,8 @@ export default class ComposerEditor extends Component {
this._throttledSyncEditorAndPreviewScroll
);
input?.addEventListener("touchmove", this._textareaTouchMove);
// Focus on the body unless we have a title
if (!this.get("composer.model.canEditTitle")) {
this.textManipulation.putCursorAtEnd();
@ -219,6 +221,8 @@ export default class ComposerEditor extends Component {
"scroll",
this._throttledSyncEditorAndPreviewScroll
);
input?.removeEventListener("touchmove", this._textareaTouchMove);
};
}
@ -278,6 +282,18 @@ export default class ComposerEditor extends Component {
);
}
_textareaTouchMove(event) {
// TODO: should we limit this to mobile + ipad?
if (event.target) {
const notScrollable =
event.target.scrollHeight <= event.target.clientHeight;
if (notScrollable) {
event.preventDefault();
event.stopPropagation();
}
}
}
_resetShouldBuildScrollMap() {
this.set("shouldBuildScrollMap", true);
}

View File

@ -83,9 +83,7 @@ html.composer-open.not-mobile-device {
.submit-panel,
.composer-fields,
.d-editor-button-bar,
textarea:placeholder-shown {
// don't allow scrolling in the submit panel
.d-editor-button-bar {
// this prevents bubbling to browser, i.e. accidental scrolls
touch-action: none;
}