From f4e404c8ce4715f137978a34e26c247b7f8d8a18 Mon Sep 17 00:00:00 2001 From: AleksanderBodurri Date: Mon, 30 Mar 2020 11:50:28 -0400 Subject: [PATCH] refactor(devtools): remove scrollIntoView ponyfill --- package.json | 1 - .../directive-forest.component.ts | 9 +--- yarn.lock | 42 +++++-------------- 3 files changed, 12 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 0c437c958d4..8cb926fcde3 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "ngx-vis": "3.0.3", "pretty-quick": "^2.0.1", "rxjs": "~6.5.3", - "scroll-into-view-if-needed": "^2.2.22", "tslib": "^1.10.0", "uuid": "^7.0.0", "webtreemap": "^2.0.1", diff --git a/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/directive-forest.component.ts b/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/directive-forest.component.ts index 59903c4e802..948b5b98b81 100644 --- a/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/directive-forest.component.ts +++ b/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/directive-forest.component.ts @@ -11,8 +11,6 @@ import { import { DevToolsNode, ElementPosition } from 'protocol'; import { CdkTree, FlatTreeControl } from '@angular/cdk/tree'; import { ComponentDataSource, FlatNode } from './component-data-source'; - -import scrollIntoView from 'scroll-into-view-if-needed'; import { isChildOf, parentCollapsed } from './directive-forest-utils'; import { IndexedNode } from './index-forest'; @@ -80,11 +78,8 @@ export class DirectiveForestComponent { if (!element) { return; } - scrollIntoView(element, { - scrollMode: 'if-needed', - block: 'nearest', - inline: 'nearest', - }); + + element.scrollIntoView({ behavior: 'auto', block: 'nearest', inline: 'nearest' }); }, 0); } diff --git a/yarn.lock b/yarn.lock index 21c870c98fb..4a136c1cbcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,16 +11,14 @@ rxjs "6.5.4" "@angular-devkit/architect@github:angular/angular-devkit-architect-builds#1e258317b": - version "0.901.0-next.4+26.1e25831" - uid dd4afab48f988e503198e0e5c075b92a635dd385 + version "0.901.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-architect-builds/tar.gz/dd4afab48f988e503198e0e5c075b92a635dd385" dependencies: "@angular-devkit/core" "github:angular/angular-devkit-core-builds#1e258317b" rxjs "6.5.4" "@angular-devkit/build-angular@github:angular/angular-devkit-build-angular-builds#4032a546bac2471243e6fa61c2e5a895e3a8f232": - version "0.901.0-next.4+26.1e25831" - uid "4032a546bac2471243e6fa61c2e5a895e3a8f232" + version "0.901.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-build-angular-builds/tar.gz/4032a546bac2471243e6fa61c2e5a895e3a8f232" dependencies: "@angular-devkit/architect" "github:angular/angular-devkit-architect-builds#1e258317b" @@ -94,8 +92,7 @@ rxjs "6.5.4" "@angular-devkit/build-optimizer@github:angular/angular-devkit-build-optimizer-builds#1e258317b": - version "0.901.0-next.4+26.1e25831" - uid ce2eb029c1cce4e86b246bb74343d2b05cac76b6 + version "0.901.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-build-optimizer-builds/tar.gz/ce2eb029c1cce4e86b246bb74343d2b05cac76b6" dependencies: loader-utils "2.0.0" @@ -105,8 +102,7 @@ webpack-sources "1.4.3" "@angular-devkit/build-webpack@github:angular/angular-devkit-build-webpack-builds#1e258317b": - version "0.901.0-next.4+26.1e25831" - uid "4cd7af7cce2b8a3ab66bae02c16a11509e0e3e1c" + version "0.901.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-build-webpack-builds/tar.gz/4cd7af7cce2b8a3ab66bae02c16a11509e0e3e1c" dependencies: "@angular-devkit/architect" "github:angular/angular-devkit-architect-builds#1e258317b" @@ -136,8 +132,7 @@ source-map "0.7.3" "@angular-devkit/core@github:angular/angular-devkit-core-builds#1e258317b": - version "9.1.0-next.4+26.1e25831" - uid "94c4701ce8d4da7f320ae2d038101dff5d067790" + version "9.1.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-core-builds/tar.gz/94c4701ce8d4da7f320ae2d038101dff5d067790" dependencies: ajv "6.12.0" @@ -155,8 +150,7 @@ rxjs "6.4.0" "@angular-devkit/schematics@github:angular/angular-devkit-schematics-builds#1e258317b": - version "9.1.0-next.4+26.1e25831" - uid "61e8d81fba68a2e51f982b29c3b7ded77bdd03ba" + version "9.1.0-next.4" resolved "https://codeload.github.com/angular/angular-devkit-schematics-builds/tar.gz/61e8d81fba68a2e51f982b29c3b7ded77bdd03ba" dependencies: "@angular-devkit/core" "github:angular/angular-devkit-core-builds#1e258317b" @@ -176,8 +170,7 @@ parse5 "^5.0.0" "@angular/cli@github:angular/cli-builds#8b09ac76f8989c8b4f3e0bc61c2278c0af25599d": - version "9.1.0-next.4+26.1e25831" - uid "8b09ac76f8989c8b4f3e0bc61c2278c0af25599d" + version "9.1.0-next.4" resolved "https://codeload.github.com/angular/cli-builds/tar.gz/8b09ac76f8989c8b4f3e0bc61c2278c0af25599d" dependencies: "@angular-devkit/architect" "github:angular/angular-devkit-architect-builds#1e258317b" @@ -1371,8 +1364,7 @@ schema-utils "^2.6.4" "@ngtools/webpack@github:angular/ngtools-webpack-builds#1e258317b": - version "9.1.0-next.4+26.1e25831" - uid a58ea732b1934cdaab3213417abb7c92bcc27d67 + version "9.1.0-next.4" resolved "https://codeload.github.com/angular/ngtools-webpack-builds/tar.gz/a58ea732b1934cdaab3213417abb7c92bcc27d67" dependencies: "@angular-devkit/core" "github:angular/angular-devkit-core-builds#1e258317b" @@ -1467,16 +1459,14 @@ "@angular-devkit/schematics" "8.0.0" "@schematics/angular@github:angular/schematics-angular-builds#1e258317b": - version "9.1.0-next.4+26.1e25831" - uid ee2597400daf29116b25f3dc3993c0984e6ae99d + version "9.1.0-next.4" resolved "https://codeload.github.com/angular/schematics-angular-builds/tar.gz/ee2597400daf29116b25f3dc3993c0984e6ae99d" dependencies: "@angular-devkit/core" "github:angular/angular-devkit-core-builds#1e258317b" "@angular-devkit/schematics" "github:angular/angular-devkit-schematics-builds#1e258317b" "@schematics/update@github:angular/schematics-update-builds#1e258317b": - version "0.901.0-next.4+26.1e25831" - uid "47bfd4475bc30694fd8a819f87c53f02997e8060" + version "0.901.0-next.4" resolved "https://codeload.github.com/angular/schematics-update-builds/tar.gz/47bfd4475bc30694fd8a819f87c53f02997e8060" dependencies: "@angular-devkit/core" "github:angular/angular-devkit-core-builds#1e258317b" @@ -3284,11 +3274,6 @@ compression@^1.7.4: safe-buffer "5.1.2" vary "~1.1.2" -compute-scroll-into-view@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.13.tgz#be1b1663b0e3f56cd5f7713082549f562a3477e2" - integrity sha512-o+w9w7A98aAFi/GjK8cxSV+CdASuPa2rR5UWs3+yHkJzWqaKoBEufFNWYaXInCSmUfDCVhesG+v9MTWqOjsxFg== - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -9248,13 +9233,6 @@ schema-utils@^2.5.0, schema-utils@^2.6.1, schema-utils@^2.6.4, schema-utils@^2.6 ajv "^6.12.0" ajv-keywords "^3.4.1" -scroll-into-view-if-needed@^2.2.22: - version "2.2.24" - resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.24.tgz#12bca532990769bd509115a49edcfa755e92a0ea" - integrity sha512-vsC6SzyIZUyJG8o4nbUDCiIwsPdH6W/FVmjT2avR2hp/yzS53JjGmg/bKD20TkoNajbu5dAQN4xR7yes4qhwtQ== - dependencies: - compute-scroll-into-view "^1.0.13" - select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"