Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: expand code editor when click on maximize button (#3191)

Bogdan Chadkinb624e7f58763
diff --git a/apps/builder/app/builder/shared/code-editor.tsx b/apps/builder/app/builder/shared/code-editor.tsx
index 00ade9421d..16a1fa4031 100644
--- a/apps/builder/app/builder/shared/code-editor.tsx
+++ b/apps/builder/app/builder/shared/code-editor.tsx
@@ -1,4 +1,11 @@
-import { useEffect, useRef, type ReactNode, useState, forwardRef } from "react";
+import {
+ useEffect,
+ useRef,
+ type ReactNode,
+ useState,
+ forwardRef,
+ type ComponentProps,
+} from "react";
import {
Annotation,
EditorState,
@@ -259,22 +266,24 @@ export const EditorDialogControl = ({ children }: { children: ReactNode }) => {
return <div className={editorDialogControlStyle()}>{children}</div>;
};
-export const EditorDialogButton = forwardRef<HTMLButtonElement>(
- (_props, ref) => {
- return (
- <SmallIconButton
- ref={ref}
- icon={<MaximizeIcon />}
- css={{
- position: "absolute",
- top: 6,
- right: 4,
- visibility: `var(--ws-code-editor-maximize-icon-visibility, hidden)`,
- }}
- />
- );
- }
-);
+export const EditorDialogButton = forwardRef<
+ HTMLButtonElement,
+ Partial<ComponentProps<typeof SmallIconButton>>
+>((props, ref) => {
+ return (
+ <SmallIconButton
+ {...props}
+ ref={ref}
+ icon={<MaximizeIcon />}
+ css={{
+ position: "absolute",
+ top: 6,
+ right: 4,
+ visibility: `var(--ws-code-editor-maximize-icon-visibility, hidden)`,
+ }}
+ />
+ );
+});
EditorDialogButton.displayName = "EditorDialogButton";
export const EditorDialog = ({