mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-03 02:35:52 +03:00
Merge pull request #4367 from urbit/james/chat/sigil-overlay
interface: fix profile overlay positioning in chat
This commit is contained in:
commit
498ef3cce7
@ -60,14 +60,8 @@ class OverlaySigil extends PureComponent<OverlaySigilProps, OverlaySigilState> {
|
|||||||
if (this.containerRef && this.containerRef.current) {
|
if (this.containerRef && this.containerRef.current) {
|
||||||
const container = this.containerRef.current;
|
const container = this.containerRef.current;
|
||||||
const scrollWindow = this.props.scrollWindow;
|
const scrollWindow = this.props.scrollWindow;
|
||||||
|
const bottomSpace = scrollWindow ? scrollWindow.clientHeight - ((container.getBoundingClientRect().top + OVERLAY_HEIGHT) - scrollWindow.getBoundingClientRect().top) : 'auto';
|
||||||
const bottomSpace = scrollWindow
|
const topSpace = scrollWindow ? container.getBoundingClientRect().top - scrollWindow.getBoundingClientRect().top : 0;
|
||||||
? scrollWindow.scrollHeight - container.offsetTop - scrollWindow.scrollTop
|
|
||||||
: 'auto';
|
|
||||||
const topSpace = scrollWindow
|
|
||||||
? scrollWindow.offsetHeight - bottomSpace - OVERLAY_HEIGHT
|
|
||||||
: 0;
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
topSpace,
|
topSpace,
|
||||||
bottomSpace
|
bottomSpace
|
||||||
@ -138,4 +132,4 @@ class OverlaySigil extends PureComponent<OverlaySigilProps, OverlaySigilState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withLocalState(OverlaySigil, ['hideAvatars']);
|
export default withLocalState(OverlaySigil, ['hideAvatars']);
|
||||||
|
Loading…
Reference in New Issue
Block a user