perf: avoid style recalc for spinner in Chrome (#2071)
This commit is contained in:
parent
16e66346d7
commit
374b8b251e
|
@ -1,4 +1,4 @@
|
||||||
<SvgIcon className="loading-spinner-icon spin {maskStyle ? 'mask-style' : ''}"
|
<SvgIcon className="loading-spinner-icon {animate ? 'spin' : ''} {maskStyle ? 'mask-style' : ''}"
|
||||||
style="width: {size}px; height: {size}px;"
|
style="width: {size}px; height: {size}px;"
|
||||||
href="#fa-spinner"
|
href="#fa-spinner"
|
||||||
ariaLabel="{intl.loading}"
|
ariaLabel="{intl.loading}"
|
||||||
|
@ -18,7 +18,8 @@
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
maskStyle: false,
|
maskStyle: false,
|
||||||
size: 64
|
size: 64,
|
||||||
|
animate: true
|
||||||
}),
|
}),
|
||||||
components: {
|
components: {
|
||||||
SvgIcon
|
SvgIcon
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
aria-hidden={!showLoading}
|
aria-hidden={!showLoading}
|
||||||
role="alert"
|
role="alert"
|
||||||
>
|
>
|
||||||
<LoadingSpinner size={48} />
|
<!-- Sapper's mousemove event listener schedules style recalculations for the loading spinner in
|
||||||
|
Chrome because it's always animating, even when hidden. So disable animations when not visible
|
||||||
|
to avoid this. -->
|
||||||
|
<LoadingSpinner size={48} animate={showLoading} />
|
||||||
<span class="loading-footer-info">
|
<span class="loading-footer-info">
|
||||||
{intl.loadingMore}
|
{intl.loadingMore}
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue