-
Notifications
You must be signed in to change notification settings - Fork 458
Html element onerror override #2161
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
Html element onerror override #2161
Conversation
|
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…crosoft#2180) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ory (microsoft#2185) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: orta <49038+orta@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: orta <49038+orta@users.noreply.github.com>
Co-authored-by: orta <49038+orta@users.noreply.github.com>
Co-authored-by: orta <49038+orta@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
…crosoft#2264) Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
@microsoft-github-policy-service agree |
This PR fixes this Typescript issue.
Originally, I created this PR, but closed it as the that approach wasn't ideal.
I started with
Omit<GlobalEventHandlers, 'onerror'>as an approach. However, I quickly realized it isn't the correct path and creates a whole slew of new problems due to how event handlers are mapped to different elements during the emit phase. (if you're curious to see what exactly I ran into, I can push up a separate PR).What this change does:
Introduces a new type
DocumentOrGlobalOnErrorHandlerwhich extends theOnErrorEventHandlerNonNulltype withHTMLElementspecific handlers. This type then overridesGlobalEventHandlersonerrorproperty. This allow us to be backwards compatible and fix the bug.This did require a change to both
types.tsandemitter.tsso thatexposedwas accounted for when creating a new typedef. I needed the newDocumentOrGlobalOnErrorHandlerto only be exposed on the dom library.the
onerrorofGlobalEventHandlerscannot be overridden by theoverrideType.tsfile. I tried to a few times, in bothmixin-insandinterfaces. It turns out it has to be overidden in thepatches/events.kdlfile.Let me know if I missed anything or another approach would be better. I think this threads the needle nicely as it works only on
domelements and still provides both the global andHTMLElementspecificonerrorhandling types.