@@ -409,45 +409,12 @@ describe('CdkDrag', () => {
409
409
410
410
describe ( 'mouse dragging when initial transform is none' , ( ) => {
411
411
it ( 'should drag an element freely to a particular position' , fakeAsync ( ( ) => {
412
- const fixture = createComponent ( StandaloneDraggableWithInitialTransformNone ) ;
413
- fixture . detectChanges ( ) ;
414
- const dragElement = fixture . componentInstance . dragElement . nativeElement ;
415
-
416
- expect ( dragElement . style . transform ) . toBe ( 'none' ) ;
417
- dragElementViaMouse ( fixture , dragElement , 50 , 100 ) ;
418
- expect ( dragElement . style . transform ) . toBe ( 'translate3d(50px, 100px, 0px)' ) ;
419
- } ) ) ;
420
-
421
- it ( 'should drag an SVG element freely to a particular position' , fakeAsync ( ( ) => {
422
- const fixture = createComponent ( StandaloneDraggableSvgWithInitialTransformNone ) ;
412
+ const fixture = createComponent ( StandaloneDraggable ) ;
423
413
fixture . detectChanges ( ) ;
424
414
const dragElement = fixture . componentInstance . dragElement . nativeElement ;
415
+ dragElement . style . transform = 'none' ;
425
416
426
- expect ( dragElement . style . transform ) . toBe ( 'none' ) ;
427
417
dragElementViaMouse ( fixture , dragElement , 50 , 100 ) ;
428
- expect ( dragElement . getAttribute ( 'transform' ) ) . toBe ( 'translate(50 100)' ) ;
429
- } ) ) ;
430
-
431
- it ( 'should drag an SVG element freely to a particular position in SVG viewBox coordinates' ,
432
- fakeAsync ( ( ) => {
433
- const fixture = createComponent ( StandaloneDraggableSvgWithViewBoxInitialTranformNone ) ;
434
- fixture . detectChanges ( ) ;
435
- const dragElement = fixture . componentInstance . dragElement . nativeElement ;
436
-
437
- expect ( dragElement . style . transform ) . toBe ( 'none' ) ;
438
- dragElementViaMouse ( fixture , dragElement , 50 , 100 ) ;
439
- expect ( dragElement . getAttribute ( 'transform' ) ) . toBe ( 'translate(100 200)' ) ;
440
- } ) ) ;
441
- } ) ;
442
-
443
- describe ( 'touch dragging when initial transform is none' , ( ) => {
444
- it ( 'should drag an element freely to a particular position' , fakeAsync ( ( ) => {
445
- const fixture = createComponent ( StandaloneDraggableWithInitialTransformNone ) ;
446
- fixture . detectChanges ( ) ;
447
- const dragElement = fixture . componentInstance . dragElement . nativeElement ;
448
-
449
- expect ( dragElement . style . transform ) . toBe ( 'none' ) ;
450
- dragElementViaTouch ( fixture , dragElement , 50 , 100 ) ;
451
418
expect ( dragElement . style . transform ) . toBe ( 'translate3d(50px, 100px, 0px)' ) ;
452
419
} ) ) ;
453
420
} ) ;
@@ -5981,21 +5948,6 @@ class StandaloneDraggable {
5981
5948
freeDragPosition ?: { x : number , y : number } ;
5982
5949
}
5983
5950
5984
- @Component ( {
5985
- template : `
5986
- <div class="wrapper" style="width: 200px; height: 200px; background: green;">
5987
- <div
5988
- cdkDrag
5989
- #dragElement
5990
- style="transform: none; width: 100px; height: 100px; background: red;"></div>
5991
- </div>
5992
- `
5993
- } )
5994
- class StandaloneDraggableWithInitialTransformNone {
5995
- @ViewChild ( 'dragElement' ) dragElement : ElementRef < HTMLElement > ;
5996
- @ViewChild ( CdkDrag ) dragInstance : CdkDrag ;
5997
- }
5998
-
5999
5951
@Component ( {
6000
5952
changeDetection : ChangeDetectionStrategy . OnPush ,
6001
5953
template : `
@@ -6020,34 +5972,6 @@ class StandaloneDraggableSvg {
6020
5972
@ViewChild ( 'dragElement' ) dragElement : ElementRef < SVGElement > ;
6021
5973
}
6022
5974
6023
- @Component ( {
6024
- template : `
6025
- <svg><g
6026
- cdkDrag
6027
- style="transform: none"
6028
- #dragElement>
6029
- <circle fill="red" r="50" cx="50" cy="50"/>
6030
- </g></svg>
6031
- `
6032
- } )
6033
- class StandaloneDraggableSvgWithInitialTransformNone {
6034
- @ViewChild ( 'dragElement' ) dragElement : ElementRef < SVGElement > ;
6035
- }
6036
-
6037
- @Component ( {
6038
- template : `
6039
- <svg width="400px" height="400px" viewBox="0 0 800 800"><g
6040
- cdkDrag
6041
- style="transform: none"
6042
- #dragElement>
6043
- <circle fill="red" r="50" cx="50" cy="50"/>
6044
- </g></svg>
6045
- `
6046
- } )
6047
- class StandaloneDraggableSvgWithViewBoxInitialTranformNone {
6048
- @ViewChild ( 'dragElement' ) dragElement : ElementRef < SVGElement > ;
6049
- }
6050
-
6051
5975
@Component ( {
6052
5976
template : `
6053
5977
<svg width="400px" height="400px" viewBox="0 0 800 800"><g
0 commit comments