diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c2e07b0..7d8c0843 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - _...Add new stuff here..._ ### 🐞 Bug fixes +- Apply layer renames when pressing Enter or leaving the ID field to avoid validating and saving the style on every keystroke. - Add distinct screen reader labels for the anchor, X offset, and Y offset in each variable anchor offset row. - Open `icon-padding` expressions in the expression editor so they can be viewed and edited. - Fix `icon-padding` showing four inputs and only saving once all four were filled; it now uses the same add/remove list as other number arrays, up to four values diff --git a/e2e/layer-editor.spec.ts b/e2e/layer-editor.spec.ts index 6f9ffebb..77c6a90e 100644 --- a/e2e/layer-editor.spec.ts +++ b/e2e/layer-editor.spec.ts @@ -45,6 +45,11 @@ describe("layer editor", () => { const id = uuid(); await when.setValue("layer-editor.layer-id.input", "foobar:" + id); + + await then(get.styleFromLocalStorage()).shouldDeepNestedInclude({ + layers: [{ id: "background:" + bgId, type: "background" }], + }); + await when.click("min-zoom"); await then(get.styleFromLocalStorage()).shouldDeepNestedInclude({ diff --git a/src/components/FieldId.tsx b/src/components/FieldId.tsx index ee868bca..47d97a17 100644 --- a/src/components/FieldId.tsx +++ b/src/components/FieldId.tsx @@ -8,6 +8,7 @@ type FieldIdProps = { wdKey: string onChange(value: string | undefined): unknown error?: {message: string} + commitOnBlur?: boolean }; export const FieldId: React.FC = (props) => { @@ -18,7 +19,8 @@ export const FieldId: React.FC = (props) => { > diff --git a/src/components/LayerEditor.tsx b/src/components/LayerEditor.tsx index 89de9bf7..d6c9b6dd 100644 --- a/src/components/LayerEditor.tsx +++ b/src/components/LayerEditor.tsx @@ -218,6 +218,7 @@ class LayerEditorInternal extends React.Component this.props.onLayerIdChange(this.props.layerIndex, this.props.layer.id, newId)} />