Skip to content

Commit 0bca2ce

Browse files
committed
examples/button/base: throws a JS error #6660
1 parent 984fef0 commit 0bca2ce

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/button/base/MainContainer.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class MainContainer extends ConfigurationViewport {
147147
module : ComboBox,
148148
forceSelection: true,
149149
labelText : 'ui',
150-
listeners : {change: me.onConfigChange.bind(me, 'ui')},
150+
listeners : {change: me.onConfigRecordChange.bind(me, 'ui')},
151151
style : {marginTop: '10px'},
152152
value : me.exampleComponent.ui,
153153

@@ -241,6 +241,14 @@ class MainContainer extends ConfigurationViewport {
241241
}]*/
242242
})
243243
}
244+
245+
/**
246+
* @param {String} config
247+
* @param {Object} opts
248+
*/
249+
onConfigRecordChange(config, opts) {
250+
this.exampleComponent[config] = opts.value['id']
251+
}
244252
}
245253

246254
export default Neo.setupClass(MainContainer);

src/component/Base.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,9 @@ class Component extends Base {
10291029
let me = this,
10301030
cls = me.cls;
10311031

1032-
NeoArray.remove(cls, `neo-${me.ntype}-${oldValue}`);
1032+
if (oldValue) {
1033+
NeoArray.remove(cls, `neo-${me.ntype}-${oldValue}`)
1034+
}
10331035

10341036
if (value && value !== '') {
10351037
NeoArray.add(cls, `neo-${me.ntype}-${value}`)

0 commit comments

Comments
 (0)