Skip to content

Build your personal knowledge base with Trilium Notes

fix(webview): layout issues when when no webviewSrc

Elian Dorana6682be251df
diff --git a/apps/client/src/widgets/type_widgets/WebView.css b/apps/client/src/widgets/type_widgets/WebView.css
index 3978a86fc5..42ac871cfb 100644
--- a/apps/client/src/widgets/type_widgets/WebView.css
+++ b/apps/client/src/widgets/type_widgets/WebView.css
@@ -1,11 +1,18 @@
.note-detail-web-view {
height: 100%;
position: relative;
+ overflow: hidden;
}
-.note-detail-web-view > * {
+.note-detail-web-view .note-detail-web-view-help {
+ margin: 50px;
+ padding: 20px 20px 0 20px;
+}
+
+.note-detail-web-view > iframe,
+.note-detail-web-view > webview {
position: absolute;
top: 0;
width: 100%;
height: 100%;
-}
\ No newline at end of file
+}
diff --git a/apps/client/src/widgets/type_widgets/WebView.tsx b/apps/client/src/widgets/type_widgets/WebView.tsx
index 15dd2da62d..c91634b02a 100644
--- a/apps/client/src/widgets/type_widgets/WebView.tsx
+++ b/apps/client/src/widgets/type_widgets/WebView.tsx
@@ -26,7 +26,7 @@ function WebViewContent({ src }: { src: string }) {
function WebViewHelp() {
return (
- <Alert className="note-detail-web-view-help" type="warning" style={{ margin: "50px", padding: "20px 20px 0px 20px;" }}>
+ <Alert className="note-detail-web-view-help" type="warning">
<h4>{t("web_view.web_view")}</h4>
<p>{t("web_view.embed_websites")}</p>
<p>{t("web_view.create_label")}</p>