mirror of
https://github.com/maputnik/editor.git
synced 2026-12-04 15:54:24 +00:00
Open icon-padding expressions in the expression editor (#2394)
Follow-up to #2391. The earlier change added a numeric list for one to four values. `FieldFunction` still sends every `padding` value to that list, including expressions made by **Convert to expression**. Recognize expression arrays before sending padding values to the number inputs. Numeric arrays and legacy scalar values still use the regular padding editor. Added a Playwright regression check that converts a saved padding value to a literal expression and verifies that the expression editor opens. The existing numeric padding tests also pass.
This commit is contained in:
1 parent
c9f44b0cd6
commit
bb1cd631a2
3 files changed
+10
-1
No files matched your search
@@ -97,7 +97,7 @@ function getDataType(value: any, fieldSpec={} as any) {
|
||||
else if (fieldSpec.type === "colorArray") {
|
||||
return "value";
|
||||
}
|
||||
else if (fieldSpec.type === "padding") {
|
||||
else if (fieldSpec.type === "padding" && (value === null || (Array.isArray(value) && typeof value[0] !== "string"))) {
|
||||
return "value";
|
||||
}
|
||||
else if (fieldSpec.type === "variableAnchorOffsetCollection" && isVariableAnchorOffsetCollection(value)) {
|
||||
|
||||
Reference in new issue
Block a user