-
Notifications
You must be signed in to change notification settings - Fork 949
DatePicker not setting value #1320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can reproduce this. Looking at the websocket messages, I notice that setting the value gives back an error:
So apparently we have a bug in the python code. This also points out that we need some place for any unhandled output to go. |
The python bug here should be pretty straightforward to fix, so setting as sprint-friendly. I'll open another issue about providing a place for unhandled output to show. |
This is now jupyter/notebook#2455. However, we can maybe mitigate this issue by having a single OutputWidget that is created by default when widgets are instantiated, and always syncing when in the scope of that output widget. If you want to see the log, just display that output widget. |
This is #1321. |
@JoshuaC3 - feel free to submit a fix, and thanks so much for trying out the 7.0 alpha so soon! It looks like the problem is that we are trying to add 1 to a string:
|
Hmmm, no, it seems like the |
Here is the update message when I change a value in the DatePicker widget:
So it appears that what is sent as the value is a string, but what is expected is a dictionary of year, month, day, etc. So it appears that the problem may be on the javascript side? Somewhere there is a miscommunication. In the javascript, it looks like the date should be going through this function:
|
(By the way, I got that by going to the Chrome debugger Network panel, clicking on the websocket connection, and examining the websocket frames...) |
I stumbled across this when addressing #1322 . The custom date serialisers never get called, so the date gets serialised as an ISO string. I think the problem is in the for (const k of state) { // handle custom serialisers here } Since Changing the iteration to be Does this sound correct, or am I missing something? If not, I'm happy to go ahead and implement this. |
I think I would use object.keys |
For reference, I was surprised that the code as it stands does not throw an exception, since typing for (const k of state) { } to for (var _i = 0, state_1 = state; _i < state_1.length; _i++) { } Since |
We should type let state: { [key: string]: any};
for (let i of state) {
// compile error
} |
This commit explicitly specifies that the argument to serialise should be an object. This would have prevented issue jupyter-widgets#1320.
I am unable to get the DatePicker to return a value. I have tried setting this using the click, typed and arrow keys. Nothing helps.
I have put in the text example to show that this works. Here is my code.
Chrome browser, using jupyter notebook through jupyterhub, ipywidgets 7.0.
Any debugging for system info needed then please let me know. Thanks.
The text was updated successfully, but these errors were encountered: