-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[BUG] Persistence does not work for Input components when 0 is entered #1098
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
for completeness, I think this is the line @josephandreas is mentioning: persistence.js#L320 I've been able to "patch" a dev server with: sed -i 's/if (newProps\[propName\])/if (newProps[propName] !== undefined)/g' <your_python_env>/lib/python3.6/site-packages/dash_renderer/dash_renderer.dev.js |
eddy-geek
added a commit
to eddy-geek/dash
that referenced
this issue
Mar 3, 2020
fixes plotly#1098 Persistence does not work for Input components when 0 is entered
This was referenced Mar 3, 2020
eddy-geek
added a commit
to eddy-geek/dash
that referenced
this issue
Mar 22, 2020
fixes plotly#1098 Persistence does not work for Input components when 0 is entered
eddy-geek
added a commit
to eddy-geek/dash
that referenced
this issue
Mar 22, 2020
fixes plotly#1098 Persistence does not work for Input components when 0 is entered
eddy-geek
added a commit
to eddy-geek/dash
that referenced
this issue
Mar 22, 2020
fixes plotly#1098 Persistence does not work for Input components when 0 is entered
alexcjohnson
added a commit
that referenced
this issue
Mar 22, 2020
🐛 fix #1098 : also persist 0, empty string etc
Thanks @eddy-geek for the fix in #1142 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
Apologies for crude formatting below, never used GitHub before.
Persistence does not work for Input types when 0 is entered.
Minimal example:
app.layout = html.Div([ dcc.Input(type='number', id='test', persistence_type='local', persistence=True) ])
Enter a number 1 in the browser and reenter 0. Refresh the browser.
Expected value in Input: 0
Given value: 1
Possible duplicates: #1034
Possible solution (at least it works in my desktop):
change
forEach(persistedProp => { const [propName, propPart] = persistedProp.split('.'); if (newProps[propName]) {
to
forEach(persistedProp => { const [propName, propPart] = persistedProp.split('.'); if (newProps[propName] !== undefined) {
The text was updated successfully, but these errors were encountered: