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: Fixes 2 bugs in advanced panel (#4935)

Oleg Isonen11c6521988f0
diff --git a/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx b/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
index 3f6575f435..2b9d053e09 100644
--- a/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/advanced/advanced.tsx
@@ -451,7 +451,7 @@ export const Section = () => {
setSearchProperties(matched as CssProperty[]);
};
- const afterAddingStyles = () => {
+ const afterChangingStyles = () => {
setIsAdding(false);
requestAnimationFrame(() => {
// We are either focusing the last value input from the recent list if available or the search input.
@@ -476,7 +476,7 @@ export const Section = () => {
</Box>
<CopyPasteMenu
onPaste={handleInsertStyles}
- properties={currentProperties}
+ properties={[...recentProperties, ...currentProperties]}
>
<Flex gap="2" direction="column">
<Flex
@@ -502,6 +502,7 @@ export const Section = () => {
(recentProperty) => recentProperty !== property
)
);
+ afterChangingStyles();
}}
/>
);
@@ -519,10 +520,10 @@ export const Section = () => {
onSubmit={(cssText: string) => {
const styles = handleInsertStyles(cssText);
if (styles.size > 0) {
- afterAddingStyles();
+ afterChangingStyles();
}
}}
- onClose={afterAddingStyles}
+ onClose={afterChangingStyles}
onFocus={() => {
if (isAdding === false) {
handleShowAddStyleInput();