diff --git a/resources/dist/index.js b/resources/dist/index.js index ac90fadf6..e41f4cbd5 100644 Binary files a/resources/dist/index.js and b/resources/dist/index.js differ diff --git a/resources/dist/index.js.map.json b/resources/dist/index.js.map.json index 43a410262..d05eeec33 100644 Binary files a/resources/dist/index.js.map.json and b/resources/dist/index.js.map.json differ diff --git a/src/preview/model.js b/src/preview/model.js index 88972a8e2..f5e2937dd 100644 --- a/src/preview/model.js +++ b/src/preview/model.js @@ -123,8 +123,11 @@ const elementMatchesSelector = ( element, selector ) => { * @return {HTMLElement|null} */ export function findNearestEligibleTarget( element ) { - const selector = selectors.join( ', ' ); - return element.closest( selector ); + if ( selectors.length ) { + const selector = selectors.join( ', ' ); + return element.closest( selector ); + } + return null; } /**