File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
projects/igniteui-angular
core/src/core/styles/components/slider
directives/src/directives/button Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 8989 // https://github.com/IgniteUI/igniteui-angular/issues/11597
9090 z-index : 0 ;
9191 height : $slider-height ;
92- flex-grow : 1 ;
9392 align-items : center ;
9493 transition : all .2s $out-quad ;
9594 touch-action : pan-y pinch- zoom;
Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ import {
99 booleanAttribute ,
1010 inject ,
1111 AfterViewInit ,
12+ OnDestroy
1213} from '@angular/core' ;
1314import { PlatformUtil } from 'igniteui-angular/core' ;
15+ import { animationFrameScheduler , Subscription } from 'rxjs' ;
1416
1517export const IgxBaseButtonType = {
1618 Flat : 'flat' ,
@@ -20,10 +22,11 @@ export const IgxBaseButtonType = {
2022
2123
2224@Directive ( )
23- export abstract class IgxButtonBaseDirective implements AfterViewInit {
25+ export abstract class IgxButtonBaseDirective implements AfterViewInit , OnDestroy {
2426 private _platformUtil = inject ( PlatformUtil ) ;
2527 public element = inject ( ElementRef ) ;
26- private _viewInit = false ;
28+ private _viewInit = false ;
29+ private _animationScheduler : Subscription ;
2730
2831 /**
2932 * Emitted when the button is clicked.
@@ -109,12 +112,16 @@ export abstract class IgxButtonBaseDirective implements AfterViewInit{
109112 if ( this . _platformUtil . isBrowser && ! this . _viewInit ) {
110113 this . _viewInit = true ;
111114
112- requestAnimationFrame ( ( ) => {
115+ this . _animationScheduler = animationFrameScheduler . schedule ( ( ) => {
113116 this . element . nativeElement . style . removeProperty ( '--_init-transition' ) ;
114117 } ) ;
115118 }
116119 }
117120
121+ public ngOnDestroy ( ) : void {
122+ this . _animationScheduler . unsubscribe ( ) ;
123+ }
124+
118125 /**
119126 * @hidden
120127 * @internal
You can’t perform that action at this time.
0 commit comments