question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOMContentLoaded is missing from autocomlete

See original GitHub issue

TypeScript Version: 2.6.2

Code

document.addEventListener('DOMContentLoaded', () => { /* Do something */ })

Expected behavior:

When typing DOMContentLoaded into the string, it should be suggested in the intellisense

Actual behavior:

All other auto completion items are suggested (click, drag, drop, etc.) except for DOMContentLoaded

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:17
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
LachlanArthurcommented, May 25, 2022

This is now available in TypeScript 4.7 (released yesterday)

image

0reactions
MasterGordoncommented, Oct 13, 2020

Looks like the solution is adding "DOMContentLoaded": Event; to DocumentEventMap (here) and WindowEventMap (here).

The files you have linked are generated with this Tool: https://github.com/microsoft/TypeScript-DOM-lib-generator

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code inside DOMContentLoaded event not working
It's most likely because the DOMContentLoaded event was already fired at this point. The best practice in general is to check for document....
Read more >
Page: DOMContentLoaded, load, beforeunload, unload
As DOMContentLoaded waits for scripts, it now waits for styles before them as well. Built-in browser autofill. Firefox, Chrome and Opera ...
Read more >
How to Troubleshoot Missing Autocomplete in Microsoft ...
Start Outlook. Click 'New Email' and start to type in names that you are expecting to find in 'Autocomplete'. You should see them...
Read more >
139814 - UAF in DOMContentLoaded
VULNERABILITY DETAILS I used details in chrome issue 136840 to make this issue. It is possible to cause webkit to fire a readystatechange...
Read more >
Autofill/Autocomplete/Insecure warning cannot be opened ...
Summary: Autofill/Autocomplete/Insecure warning not working first time you access ... DOMContentLoaded seems too late to me since a focus could have already ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found