1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix SettingLayout

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-10-14 15:58:25 -04:00
parent 37feed7e1e
commit 72796d5813
2 changed files with 7 additions and 2 deletions

View File

@ -38,6 +38,6 @@ fetchMock.enableMocks();
// Mock __non_webpack_require__ for tests
globalThis.__non_webpack_require__ = jest.fn();
process.on("unhandledRejection", (err) => {
process.on("unhandledRejection", (err: any) => {
fail(err);
});

View File

@ -50,8 +50,13 @@ export class SettingLayout extends React.Component<SettingLayoutProps> {
static defaultProps = defaultProps as object;
async componentDidMount() {
const { hash } = window.location;
if (hash) {
document.querySelector(hash)?.scrollIntoView();
}
window.addEventListener("keydown", this.onEscapeKey);
document.querySelector(window.location.hash)?.scrollIntoView();
}
componentWillUnmount() {