File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ export function isElementInternalsSupported(): boolean {
285
285
}
286
286
287
287
if ( ! isElementInternalsSupported ( ) ) {
288
+ /** @ts -expect-error: we need to replace the default ElementInternals */
288
289
window . ElementInternals = ElementInternals ;
289
290
290
291
@@ -313,11 +314,11 @@ if (!isElementInternalsSupported()) {
313
314
*/
314
315
Object . defineProperty ( HTMLElement . prototype , 'attachInternals' , {
315
316
get ( ) {
316
- return ( ) => {
317
+ return ( ) : IElementInternals => {
317
318
if ( this . tagName . indexOf ( '-' ) === - 1 ) {
318
319
throw new Error ( `Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.` ) ;
319
320
}
320
- return new ElementInternals ( this ) ;
321
+ return new ElementInternals ( this ) as IElementInternals ;
321
322
} ;
322
323
}
323
324
} ) ;
You can’t perform that action at this time.
0 commit comments