diff --git a/routes/_components/compose/LiteComposeBox.html b/routes/_components/compose/LiteComposeBox.html index ae904f0..cc08931 100644 --- a/routes/_components/compose/LiteComposeBox.html +++ b/routes/_components/compose/LiteComposeBox.html @@ -153,8 +153,14 @@ export default { oncreate() { this.set({inputText: store.get('currentInputTextInCompose')}) - const saveText = debounce(() => scheduleIdleTask(() => this.store.save()), 1000) + requestAnimationFrame(() => { + mark('autosize()') + autosize(this.refs.textarea) + stop('autosize()') + }) + + const saveText = debounce(() => scheduleIdleTask(() => this.store.save()), 1000) this.observe('inputText', inputText => { let inputTextInCompose = this.store.get('inputTextInCompose') let currentInstance = this.store.get('currentInstance') @@ -163,12 +169,6 @@ saveText() }, {init: false}) - requestAnimationFrame(() => { - mark('autosize()') - autosize(this.refs.textarea) - stop('autosize()') - }) - // Avoid input delays by updating these values after a rAF this.observe('inputLengthToDisplay', inputLengthToDisplay => { requestAnimationFrame(() => { diff --git a/routes/_components/virtualList/VirtualListContainer.html b/routes/_components/virtualList/VirtualListContainer.html index 732dc28..d78cf74 100644 --- a/routes/_components/virtualList/VirtualListContainer.html +++ b/routes/_components/virtualList/VirtualListContainer.html @@ -29,9 +29,11 @@ } }) } else { - this.store.setForRealm({ - scrollHeight: node.scrollHeight, - offsetHeight: node.offsetHeight + requestAnimationFrame(() => { + this.store.setForRealm({ + scrollHeight: node.scrollHeight, + offsetHeight: node.offsetHeight + }) }) } stop('onCreate VirtualListContainer')