Skip to content

Commit

Permalink
Fix TypeScript error related to embedWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Oct 11, 2024
1 parent 46ba7e3 commit 0bc521e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions plugins/embed-optimizer/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@ const loadedElementContentRects = new Map();
* @param {InitializeArgs} args Args.
*/
export function initialize( { isDebug } ) {
const embedWrappers =
/** @type NodeListOf<HTMLDivElement> */ document.querySelectorAll(
'.wp-block-embed > .wp-block-embed__wrapper[data-od-xpath]'
);
/** @type NodeListOf<HTMLDivElement> */
const embedWrappers = document.querySelectorAll(
'.wp-block-embed > .wp-block-embed__wrapper[data-od-xpath]'
);

for ( const embedWrapper of embedWrappers ) {
monitorEmbedWrapperForResizes(
embedWrapper, // TODO: Why TypeScript error: TS2345: Argument of type Element is not assignable to parameter of type HTMLDivElement.
isDebug
);
monitorEmbedWrapperForResizes( embedWrapper, isDebug );
}

if ( isDebug ) {
Expand Down

0 comments on commit 0bc521e

Please sign in to comment.