Skip to content

Commit 2f1fb25

Browse files
authored
fix: Fix drop shadow for filters and backdrop filters (#5437)
Fixes #5435 ## Description 1. What is this PR about (link the issue and add a short description) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 348a48e commit 2f1fb25

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

apps/builder/app/builder/features/style-panel/shared/filter-content.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,23 @@ export const FilterSectionContent = ({
109109
>(undefined);
110110

111111
useEffect(() => {
112-
if (
113-
layer.type !== "function" ||
114-
isFilterFunction(layer.name) === false ||
115-
layer.args.type !== "tuple"
116-
) {
112+
if (layer.type !== "function" || isFilterFunction(layer.name) === false) {
113+
return;
114+
}
115+
if (layer.args.type !== "tuple" && layer.args.type !== "shadow") {
117116
return;
118117
}
119-
120118
setFilterFunction(layer.name);
121-
setFilterFunctionValue(layer.args.value[0]);
122119
setIntermediateValue({
123120
type: "intermediate",
124121
value: propertyValue,
125122
});
123+
if (layer.args.type === "tuple") {
124+
setFilterFunctionValue(layer.args.value[0]);
125+
}
126+
if (layer.args.type === "shadow") {
127+
setFilterFunctionValue(layer.args);
128+
}
126129
}, [layer, propertyValue]);
127130

128131
const handleFilterFunctionChange = (filterName: FilterFunction) => {

0 commit comments

Comments
 (0)