|
2 | 2 | <div |
3 | 3 | data-testid="visualization" |
4 | 4 | class="visualization" |
5 | | - :class="{ 'visualization--ready': visualizationReady }" |
| 5 | + :class="{ 'visualization--ready': transitionsEnabled }" |
6 | 6 | > |
7 | 7 | <div class="label-scale d-flex"> |
8 | 8 | <div class="d-flex justify-content-start flex-grow-1"> |
@@ -140,7 +140,7 @@ export default defineComponent({ |
140 | 140 | outPower: { type: Number, default: 0 }, |
141 | 141 | }, |
142 | 142 | data() { |
143 | | - return { width: 0 }; |
| 143 | + return { width: 0, transitionsEnabled: false }; |
144 | 144 | }, |
145 | 145 | computed: { |
146 | 146 | gridExport() { |
@@ -189,6 +189,18 @@ export default defineComponent({ |
189 | 189 | }, |
190 | 190 | }, |
191 | 191 |
|
| 192 | + watch: { |
| 193 | + visualizationReady(newVal: boolean) { |
| 194 | + if (newVal && !this.transitionsEnabled) { |
| 195 | + // ensure screen is drawn before enabling transitions |
| 196 | + requestAnimationFrame(() => { |
| 197 | + requestAnimationFrame(() => { |
| 198 | + this.transitionsEnabled = true; |
| 199 | + }); |
| 200 | + }); |
| 201 | + } |
| 202 | + }, |
| 203 | + }, |
192 | 204 | mounted() { |
193 | 205 | this.$nextTick(function () { |
194 | 206 | window.addEventListener("resize", this.updateElementWidth); |
@@ -321,6 +333,8 @@ html.dark .grid-import { |
321 | 333 | right: -0.25rem; |
322 | 334 | color: var(--evcc-gray); |
323 | 335 | opacity: 0; |
| 336 | +} |
| 337 | +.visualization--ready .battery-hold { |
324 | 338 | transition-property: opacity; |
325 | 339 | transition-duration: var(--evcc-transition-medium); |
326 | 340 | transition-timing-function: linear; |
|
0 commit comments