Skip to content

Commit

Permalink
Fix bizarre typescript complaint
Browse files Browse the repository at this point in the history
works just fine in actual browsers, but typescript really wants document for whatever reason

see https://stackoverflow.com/questions/74809554/cant-get-paste-event-to-work-in-typescript :|
  • Loading branch information
cee-chen committed Sep 17, 2024
1 parent 4690094 commit 3d837bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eui/src/services/copy/tabular_copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const OverrideCopiedTabularContent = ({
// Chrome and webkit browsers work perfectly when passing `onTabularCopy` to a React
// `onCopy` prop, but sadly Firefox does not if copying more than just the table/grid
// (e.g. Ctrl+A). So we have to set up a global window event listener
window.addEventListener('copy', onTabularCopy);
window.document.addEventListener('copy', onTabularCopy);
// Note: Since onCopy is static, we don't have to worry about duplicate
// event listeners - it's automatically handled by the browser. See:
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Multiple_identical_event_listeners
Expand Down

0 comments on commit 3d837bf

Please sign in to comment.