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.

Some fixes in props panel (#1546)

Roman Pominov86ee37a7ad08
diff --git a/apps/builder/app/builder/features/props-panel/controls/text.tsx b/apps/builder/app/builder/features/props-panel/controls/text.tsx
index 2b38fb81f1..38cd6f2010 100644
--- a/apps/builder/app/builder/features/props-panel/controls/text.tsx
+++ b/apps/builder/app/builder/features/props-panel/controls/text.tsx
@@ -67,6 +67,11 @@ const AsTextarea = ({
onChange={(event) => localValue.set(event.target.value)}
onBlur={localValue.save}
rows={rows ?? 1}
+ onKeyDown={(event) => {
+ if (event.key === "Enter" && event.metaKey) {
+ localValue.save();
+ }
+ }}
/>
</Flex>
</VerticalLayout>
diff --git a/apps/builder/app/builder/features/props-panel/props-panel.tsx b/apps/builder/app/builder/features/props-panel/props-panel.tsx
index 9396c768a3..51f2c4c164 100644
--- a/apps/builder/app/builder/features/props-panel/props-panel.tsx
+++ b/apps/builder/app/builder/features/props-panel/props-panel.tsx
@@ -207,16 +207,19 @@ export const PropsPanel = (props: PropsPanelProps) => {
<Separator />
- <Row
- css={{
- paddingTop: theme.spacing[5],
- paddingBottom: theme.spacing[5],
- }}
- >
- {logic.initialProps.map((item) => renderProperty(props, item))}
- </Row>
-
- <Separator />
+ {logic.initialProps.length > 0 && (
+ <>
+ <Row
+ css={{
+ paddingTop: theme.spacing[5],
+ paddingBottom: theme.spacing[5],
+ }}
+ >
+ {logic.initialProps.map((item) => renderProperty(props, item))}
+ </Row>
+ <Separator />
+ </>
+ )}
<CollapsibleSectionWithAddButton
label="Properties"
diff --git a/apps/builder/app/builder/features/props-panel/use-props-logic.ts b/apps/builder/app/builder/features/props-panel/use-props-logic.ts
index 4e461b21fd..ceeb4a3ab0 100644
--- a/apps/builder/app/builder/features/props-panel/use-props-logic.ts
+++ b/apps/builder/app/builder/features/props-panel/use-props-logic.ts
@@ -198,13 +198,6 @@ export const usePropsLogic = ({
return { prop: saved, propName: name, meta: known };
});
- // can happen only if there is a bug
- if (unprocessedSaved.size > 0) {
- throw new Error(
- `Expected all saved props to be processed, but there are ${unprocessedSaved.size} left`
- );
- }
-
const handleAdd = (propName: string) => {
const propMeta = unprocessedKnown.get(propName);
if (propMeta === undefined) {