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:
1 parent
37feed7e1e
commit
72796d5813
2 files changed
+7
-2
No files matched your search
+1
-1
@@ -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);
|
||||
});
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user