Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Channel set does not clear list properly #266

Closed
parente opened this issue Mar 16, 2016 · 4 comments
Closed

Channel set does not clear list properly #266

parente opened this issue Mar 16, 2016 · 4 comments

Comments

@parente
Copy link
Member

parente commented Mar 16, 2016

Using jupyter-declarativewidgets==0.4.2. Might be fixed on master?

To start slaIDs.items is an array in a channel with engagementChannel as its ID. Then, in the JS console we see:

// no event fires
$('#engagementChannel').get(0).set('slaIDs.items', [])
undefined

// and the reset to empty array doesn't take effect
$('#engagementChannel').get(0).get('slaIDs.items')
[0, 1]

// if we change the value in the array, it works
$('#engagementChannel').get(0).set('slaIDs.items', [3])
jupyter-widget-behavior.html:126 Urth.JupyterWidgetBehavior send - sending message Object {event: "change", data: Object}
urth-core-function.html:430 urth-core-function handling change to sla_ids
urth-core-function.html:346 urth-core-function _onParameterChange sla_ids [3]
undefined

// now if we set to empty array, it also works (huh?)
$('#engagementChannel').get(0).set('slaIDs.items', [])
jupyter-widget-behavior.html:126 Urth.JupyterWidgetBehavior send - sending message Object {event: "change", data: Object}
urth-core-function.html:430 urth-core-function handling change to sla_ids
urth-core-function.html:346 urth-core-function _onParameterChange sla_ids []
@purdrew
Copy link
Contributor

purdrew commented Mar 17, 2016

How is slaIDs.items initialized or being set prior to this JS code?

@purdrew
Copy link
Contributor

purdrew commented Mar 28, 2016

@parente Can you give me a little more information around the initial setup that makes this situation reproducible. I can see a possible explanation for the initial .set not clearing the array but have not reproduced in the notebook. I'm guessing there was some Python code that had initialized the Python side of the channel data for slaIDs.items to [0, 1] but when I try to do something similar I can't reproduce the issue.

@parente
Copy link
Member Author

parente commented Mar 28, 2016

Sorry for not responding last time you asked. I'll try to create a small reproducible example notebook sometime this week.

@parente
Copy link
Member Author

parente commented Mar 29, 2016

Appears to be fixed in 0.5.0dev0. Probably fixed by #249.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants