fix length gauge
This commit is contained in:
parent
1603c7a13b
commit
136ec67d61
|
@ -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}))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue