diff --git a/packages/editor/src/editor-ui/assets/edusharing.svg b/packages/editor/src/editor-ui/assets/edusharing.svg index 19101e9086..e3de67a7e7 100644 --- a/packages/editor/src/editor-ui/assets/edusharing.svg +++ b/packages/editor/src/editor-ui/assets/edusharing.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/editor/src/plugins/edusharing-asset/editor.tsx b/packages/editor/src/plugins/edusharing-asset/editor.tsx index c0bf603812..2363f0ae2c 100644 --- a/packages/editor/src/plugins/edusharing-asset/editor.tsx +++ b/packages/editor/src/plugins/edusharing-asset/editor.tsx @@ -1,6 +1,7 @@ import { EditorMetaContext } from '@editor/core/contexts/editor-meta-context' import { EditorModal } from '@editor/editor-ui/editor-modal' import { useEditStrings } from '@editor/i18n/edit-strings-provider' +import { cn } from '@editor/utils/cn' import * as t from 'io-ts' import { useContext, useEffect, useRef, useState } from 'react' @@ -79,12 +80,20 @@ export function EdusharingAssetEditor({ ) - // Transparent overlay while the edu-sharing plugin is unfocused. Clicking it will focus the plugin and let the user interact with the content. + // Transparent overlay. If the plugin is ... + // ... unfocused -> Clicking it will focus the plugin + // ... focused -> Clicking it does nothing and the events are handled in the iframe behind it // Explanation: Content is inside an iframe. Clicking within the iframe does sadly not change the editor focus automatically. Solutions I found are not easy and don't work reliably. So, we require an extra click from the user to be able to interact with the content in the editor. function renderOverlay() { - if (focused) return null - - return
+ const captureClick = !focused + return ( +
+ ) } function renderPluginToolbar() { diff --git a/packages/editor/src/plugins/edusharing-asset/renderer.tsx b/packages/editor/src/plugins/edusharing-asset/renderer.tsx index 2ddaee1717..9240f47626 100644 --- a/packages/editor/src/plugins/edusharing-asset/renderer.tsx +++ b/packages/editor/src/plugins/edusharing-asset/renderer.tsx @@ -100,8 +100,8 @@ export function EdusharingAssetRenderer(props: { {embedHtml ? ( renderEmbed() ) : ( -
- +
+
)}