Skip to content

[Bug] Feature property change updates undo/redo store #919

Description

@RLaipins

Describe the bug

I have run into a problem where I want to update properties purely for dynamic style changes.

Property updates count as a feature change and updates the undo/redo store. For example, I have code that sets some default properties to drawings right after their creation, which updates the undo/redo store twice (shown in repro).

Another use case is if I want to highlight a feature by adding a property highligted, each highlight toggle (property update) causes undo/redo store to be updated.

I'm running version:
Terra Draw npm version
"terra-draw": "1.31.1",
"terra-draw-maplibre-gl-adapter": "1.4.1",

To Reproduce

Reproduction sandbox: https://stackblitz.com/edit/baiadyvr?file=src%2Fapp%2Fapp.ts

Steps to reproduce the behavior:

  1. Draw a feature
  2. Use updateFeatureProperties() to change a property
  3. Check undo/redo store
  4. See Undo size increase

Expected behavior

I'm expecting regular property updates not to cause updates for undo/redo store. I understand that this could be an actual feature for some specific cases or maybe some people already use this feature, therefore some sort of opt-in or opt-out, could be useful.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: linux mint
  • Browser: chrome
  • Version [e.g. 22]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions