mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-12 14:16:12 +01:00
[Glitch] Only scroll to the compose form if it's not horizontally in the viewport
Port c07cca4727
to glitch-soc
This commit is contained in:
parent
a0b614f10a
commit
64f3bc77ac
@ -197,7 +197,10 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
handleFocus = () => {
|
||||
if (this.composeForm && !this.props.singleColumn) {
|
||||
this.composeForm.scrollIntoView();
|
||||
const { left, right } = this.composeForm.getBoundingClientRect();
|
||||
if (left < 0 || right > (window.innerWidth || document.documentElement.clientWidth)) {
|
||||
this.composeForm.scrollIntoView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user