fix length gauge

This commit is contained in:
Nolan Lawson 2018-03-12 10:06:41 -07:00
parent 1603c7a13b
commit 136ec67d61
1 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<div class="compose-box-length-gauge {{shouldAnimate ? 'should-animate' : ''}} {{overLimit ? 'over-char-limit' : ''}}" <div class="compose-box-length-gauge {{shouldAnimate ? 'should-animate' : ''}} {{overLimit ? 'over-char-limit' : ''}}"
style="transform: scaleX({{inputLengthAsFractionRoundedAfterRaf || 0}});" style="transform: scaleX({{lengthAsFractionRoundedAfterRaf || 0}});"
aria-hidden="true" aria-hidden="true"
></div> ></div>
<style> <style>
@ -25,11 +25,11 @@
export default { export default {
oncreate() { oncreate() {
// perf improvement for keyboard input latency // perf improvement for keyboard input latency
this.observe('inputLengthAsFractionRounded', inputLengthAsFractionRounded => { this.observe('lengthAsFractionRounded', lengthAsFractionRounded => {
requestAnimationFrame(() => { requestAnimationFrame(() => {
mark('set inputLengthAsFractionRoundedAfterRaf') mark('set lengthAsFractionRoundedAfterRaf')
this.set({inputLengthAsFractionRoundedAfterRaf: inputLengthAsFractionRounded}) this.set({lengthAsFractionRoundedAfterRaf: lengthAsFractionRounded})
stop('set inputLengthAsFractionRoundedAfterRaf') stop('set lengthAsFractionRoundedAfterRaf')
requestAnimationFrame(() => this.set({shouldAnimate: true})) requestAnimationFrame(() => this.set({shouldAnimate: true}))
}) })
}) })