the browser-facing portion of osu!

getBoundingClientRect().height is 0 when navigating via history on first render

bakaneko 64e4fa5b 459ef4ad

+9 -4
+5 -2
resources/js/beatmap-discussions/new-discussion.tsx
··· 137 137 } 138 138 139 139 componentDidMount() { 140 - this.updateStickToHeight(); 141 140 // watching for height changes on the stickTo element to handle horizontal scrollbars when they appear. 142 141 $(window).on('resize', this.updateStickToHeight); 143 - this.disposers.add(core.reactTurbolinks.runAfterPageLoad(action(() => this.mounted = true))); 142 + this.disposers.add(core.reactTurbolinks.runAfterPageLoad(action(() => { 143 + this.mounted = true; 144 + this.updateStickToHeight(); 145 + }))); 146 + 144 147 if (this.props.autoFocus) { 145 148 this.disposers.add(core.reactTurbolinks.runAfterPageLoad(() => this.inputBox.current?.focus())); 146 149 }
+4 -2
resources/js/beatmap-discussions/new-review.tsx
··· 56 56 } 57 57 58 58 componentDidMount(): void { 59 - this.updateStickToHeight(); 60 59 // watching for height changes on the stickTo element to handle horizontal scrollbars when they appear. 61 60 $(window).on('resize', this.updateStickToHeight); 62 - this.disposers.add(core.reactTurbolinks.runAfterPageLoad(action(() => this.mounted = true))); 61 + this.disposers.add(core.reactTurbolinks.runAfterPageLoad(action(() => { 62 + this.mounted = true; 63 + this.updateStickToHeight(); 64 + }))); 63 65 } 64 66 65 67 componentWillUnmount(): void {