Skip to content

Commit

Permalink
feat(core): remove scroll-into-view-if-needed #144
Browse files Browse the repository at this point in the history
  • Loading branch information
pubuzhixing8 committed Nov 3, 2021
1 parent a37a2a2 commit 2c96187
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 30 deletions.
15 changes: 1 addition & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"direction": "^1.0.3",
"is-hotkey": "^0.1.6",
"rxjs": "~6.6.0",
"scroll-into-view-if-needed": "^2.2.20",
"slate": "0.63.0",
"slate-history": "0.62.0",
"tslib": "^2.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"slate-history",
"debug",
"direction",
"is-hotkey",
"scroll-into-view-if-needed"
"is-hotkey"
]
}
3 changes: 1 addition & 2 deletions packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"slate-history": "^0.62.0",
"debug": "^4.1.1",
"direction": "^1.0.3",
"is-hotkey": "^0.1.6",
"scroll-into-view-if-needed": "^2.2.20"
"is-hotkey": "^0.1.6"
},
"peerDependencies": {
"slate": ">= 0.63.0"
Expand Down
11 changes: 0 additions & 11 deletions packages/src/components/editable/editable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
} from '../../utils/dom';
import { Subject, interval } from 'rxjs';
import { takeUntil, throttle } from 'rxjs/operators';
import scrollIntoView from 'scroll-into-view-if-needed';
import { IS_FIREFOX, IS_SAFARI, IS_EDGE_LEGACY, IS_CHROME_LEGACY } from '../../utils/environment';
import Hotkeys from '../../utils/hotkeys';
import { BeforeInputEvent, extractBeforeInputEvent } from '../../custom-event/BeforeInputEventPlugin';
Expand Down Expand Up @@ -321,16 +320,6 @@ export class SlateEditableComponent implements OnInit, OnChanges, OnDestroy, Aft
newDomRange.endOffset
);
}
const leafEl = newDomRange.startContainer.parentElement!;
leafEl.getBoundingClientRect = newDomRange.getBoundingClientRect.bind(
newDomRange
);
scrollIntoView(leafEl, {
scrollMode: 'if-needed',
boundary: el,
});
// @ts-ignore
delete leafEl.getBoundingClientRect;
}

setTimeout(() => {
Expand Down

0 comments on commit 2c96187

Please sign in to comment.