# \[BUG-6587\] Perspective - editing multiple component props.styles overrides entire styles object

**URL:** <https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 11, 2022, 5:01am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901 "2022-08-11T05:01:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 11, 2022, 5:01am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/1 "2022-08-11T05:01:18Z")

</div>

v8.1.18

When editing multiple components, adding new entries into props.styles overrides the entire props.styles object for all components instead of just adding the new key to each.  
Pretty sure this has been an issue for many versions prior to this as well ~~and it likely affects _all_ object type props~~ Nope, it doesn’t affect for example `props.params` - params keys can be added and params key values can be modified without affecting the other keys which affirms my position this is a bug.

It also affects `custom.<objects>`

EDIT:  
Converted to a feature request, here:

> **[Add Replace/Merge split toggle to Perspective Styles editor | Voters |...](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/add-replacemerge-split-toggle-to-perspective-styles-editor)**

---

<div class="post-metadata">

**Author:** ![plo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/plo/32/33875_2.png) [@plo](https://forum.inductiveautomation.com/u/plo)\
**Post date:** [September 9, 2022, 6:43pm UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/2 "2022-09-09T18:43:53Z")

</div>

Hello Nick!  
Thanks for reporting this. I am able to replicate the behavior and have submitted a bug ticket for review. I’ll update this post again when there is more to share. Thanks!

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 12, 2022, 3:45pm UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/3 "2022-09-12T15:45:46Z")

</div>

@nminchin Can you please clarify what this bug report means? I am unclear. Are you using the “Modify Style” button or the “Add Object Member…” button? or something else entirely?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 13, 2022, 12:06am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/4 "2022-09-13T00:06:44Z")

</div>

For styles:

- Using the ‘Modify styles’ button overwrites styles for all selected components, removing unique styles defined on particular components  
 ![Edit multiple component style overwritten](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d925f7e08abdfce31a27de62f4c683c4022a030c.gif)

- Adding new keys manually _doesn’t_ remove unique styles

For custom fields, this only appears to remove keys that are named `key`. Not really an issue as hopefully no one names a used key “key”… 🙂

![Edit multiple component style and custom keys](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99f8989eb2dd2d8fde80415e7d9ad3a0ec8b1c27.gif)

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 13, 2022, 12:21am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/5 "2022-09-13T00:21:52Z")

</div>

ok, right, the styles editor popup thinks of a “style” object as an atomic thing. When you hit OK, it is _setting_ the style object on the components in the selection, not doing some sort of merge.

The other button (the “add member” button) isn’t “setting” the object, it is injecting a new child into the object, so any other keys in there will remain untouched. it should work the same for styles as it does for custom or anything else.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 13, 2022, 12:28am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/6 "2022-09-13T00:28:50Z")

</div>

That’s what I assumed, but this isn’t how I would have assumed it to work as a user. I guess it’s not so much a bug as it is a feature request to have it changed in approach 🤷‍♂️ it feels a bit inconsistent as it is, as both methods are adding styling to a selection of components, one graphically and one manually, but both implement them differently

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 13, 2022, 12:52am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/7 "2022-09-13T00:52:07Z")

</div>

Yeah, I can see your point, but I think an argument could be made either way. I think the problem with your idea is that it falls apart for the common case: _single_ component selection.

Consider this: let’s say that the styles popup did a “merge” of the styles you’d selected in the UI and the styles that already existed on the selection.

Now, you select a component that has a style, let’s say, it has margin set on it. You decide that instead of margin, you want padding. So you _remove_ margin in the UI and _add_ padding. Now you hit OK. The style editor does a “merge” of the style you’d designed and the existing object. Now you have margin _and_ padding on your style object.

Pretty sure in that case you’d also be filing a bug report.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 13, 2022, 12:54am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/8 "2022-09-13T00:54:50Z")

</div>

Most likely, haha 😆 It’s a tough one! Maybe a selection to `replace` or `merge` style configuration, defaulted to `replace`?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 13, 2022, 1:21am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/9 "2022-09-13T01:21:21Z")

</div>

Yeah, something like that could work. Maybe a split button or something.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 13, 2022, 1:46am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/10 "2022-09-13T01:46:17Z")

</div>

I’ve added an idea for your register

> **[Add Replace/Merge split toggle to Perspective Styles editor | Voters |...](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/add-replacemerge-split-toggle-to-perspective-styles-editor)**

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [September 13, 2022, 9:54am UTC](https://forum.inductiveautomation.com/t/bug-6587-perspective-editing-multiple-component-props-styles-overrides-entire-styles-object/62901/11 "2022-09-13T09:54:15Z")

</div>

> [@nminchin](#):
>
> hopefully no one names a used key “key”…

What if you're a locksmith ?
