Skip to content

Commit f098399

Browse files
committed
refactor: use custom merge function for nested option merging
1 parent 99792f9 commit f098399

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/components/controls/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import actions from '../../common/actions'
55
import { indexOfNode, orderObjectsBy, get } from '../../common/helpers'
66
import events from '../../common/events'
77
import dom from '../../common/dom'
8-
import { match, unique, uuid } from '../../common/utils'
8+
import { match, unique, uuid, merge } from '../../common/utils'
99
import Panels from '../panels'
1010
import Field from '../fields/field'
1111
import Control from './control'
@@ -379,7 +379,7 @@ export class Controls {
379379
}
380380

381381
applyOptions = (controlOptions = {}) => {
382-
const { container, elements, groupOrder, ...options } = { ...defaultOptions, controlOptions }
382+
const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions, { mergeArray: true })
383383
this.container = container
384384
this.groupOrder = unique(groupOrder.concat(['common', 'html', 'layout']))
385385
this.elements = elements.concat(defaultElements)

0 commit comments

Comments
 (0)