Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

refactor: type events to remove need to cast #1126

Closed
wants to merge 1 commit into from
Closed

Conversation

haxxmaxx
Copy link
Collaborator

@haxxmaxx haxxmaxx commented Jan 18, 2024

  • Realized we could (and should) use currentTarget which can actually be typed. This removes most castings to HTMLElement There are a couple exceptions:
    • onContextMenu, since we don't control where the event comes from
    • getElementsByClassName, since the return type is not generic
    • isEventFromColumnAdjuster, since we might move this to common repo
    • native FocusEvent, the target types are hard coded
  • Rewrite of copyCellValue. It becomes much cleaner if you just pass the cell element, which is currentElement in the keyboard functions, and we already get from closest in onContextMenu. plus the arg type becomes simpler

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant