-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix infobox collapse #2237
Fix infobox collapse #2237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, havent tested, thoughts:
evap/static/ts/src/infobox.ts
Outdated
@@ -6,6 +6,7 @@ export class InfoboxLogic { | |||
private readonly infobox: HTMLDivElement; | |||
private readonly closeButton: HTMLButtonElement; | |||
private readonly storageKey: string; | |||
private timeout?: NodeJS.Timeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems odd, we are not targetting node, so the inferred type should be a browser timeout, not a nodejs one. Do we have typescript misconfigured somewhere? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay: by default, tsc imports all @types/*
into the global namespace. As we have @types/node
because of jest, this works here.
If I excluded the jest types (and thereby node's types) this compiles with number
but compilation of the ts tests fail, see e501844
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. According to this, using window.setTimeout
(or the returntype trick they use) could work - if not, we can come back to this later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it works! Adding it to tsconfig.compile.json
should work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ UI checked
fe81587
to
b292222
Compare
fixes a bug, when the info box is closed during opening of the infobox. Now, we hard abort the opening process and further clear the "opening" timeout to prevent the class to be removed unexpectedly.