more perf improvements

This commit is contained in:
Nolan Lawson 2018-02-25 22:50:50 -08:00
parent 96303583ad
commit e65087e8d1
2 changed files with 12 additions and 10 deletions

View file

@ -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(() => {

View file

@ -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')