Skip to content

Commit

Permalink
fix(blocks): prevent hiding keyboard when scrolling (#8989)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Sun committed Dec 16, 2024
1 parent 04e2990 commit 8f17863
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export class AffineKeyboardToolbar extends SignalWatcher(
) {
static override styles = keyboardToolbarStyles;

private _autoScrolling = false;

private readonly _closeToolPanel = () => {
if (!this._isPanelOpened) return;

Expand Down Expand Up @@ -110,14 +108,10 @@ export class AffineKeyboardToolbar extends SignalWatcher(

if (y2 < y1 + gap) return;

this._autoScrolling = true;
scrollTo({
top: window.scrollY + y2 - y1 + gap,
behavior: 'instant',
});
requestAnimationFrame(() => {
this._autoScrolling = false;
});
})
.run();
};
Expand Down Expand Up @@ -289,10 +283,6 @@ export class AffineKeyboardToolbar extends SignalWatcher(
});
})
);

this.disposables.addFromEvent(window, 'scroll', () => {
if (!this._autoScrolling) this.close(true);
});
}

override disconnectedCallback() {
Expand Down

0 comments on commit 8f17863

Please sign in to comment.