Skip to content

Commit

Permalink
fix: allow reassignment of HTMLElement.prototype.focus and .blur (#…
Browse files Browse the repository at this point in the history
…1265)

Co-authored-by: Philipp Fritsche <ph.fritsche@gmail.com>
  • Loading branch information
jakeboone02 and ph-fritsche authored Feb 5, 2025
1 parent c6ae212 commit 63ac399
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/document/patchFocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ export function patchFocus(HTMLElement: typeof globalThis['HTMLElement']) {
Object.defineProperties(HTMLElement.prototype, {
focus: {
configurable: true,
get: () => patchedFocus,
value: patchedFocus,
writable: true,
},
blur: {
configurable: true,
get: () => patchedBlur,
value: patchedBlur,
writable: true,
},
[patched]: {
configurable: true,
Expand Down

0 comments on commit 63ac399

Please sign in to comment.