Ipywidgets: FileUpload counter with multiple=False

Created on 3 Jul 2019  路  2Comments  路  Source: jupyter-widgets/ipywidgets

It looks a bit odd that the FileUpload counter is increasing every time a file is uploaded, even when multiple=False is set:

fileupload-counter

When multiple=False is set shouldn't the counter equal to 1?

Can be tested with:

from ipywidgets import FileUpload, Output

out = Output()

@out.capture()
def show_content(change):
    print(change['new'].keys())

w = FileUpload(multiple=False)
w.observe(show_content, 'value')
with out:
    display(w)
out
resolved-locked

Most helpful comment

I'm also wondering about this -- even when multiple=True, the counter _increments_ after each upload (even though the new value only contains the most recent set of uploaded files), and there doesn't seem to be a way to reset it (in a callback, for example) after processing the files.
Screenshot 2019-10-31 10 04 12

How can we reset the counter?

All 2 comments

I'm also wondering about this -- even when multiple=True, the counter _increments_ after each upload (even though the new value only contains the most recent set of uploaded files), and there doesn't seem to be a way to reset it (in a callback, for example) after processing the files.
Screenshot 2019-10-31 10 04 12

How can we reset the counter?

Hello,

Facing the same issue, is there any workaround to reset the widget ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pbugnion picture pbugnion  路  4Comments

aidanheerdegen picture aidanheerdegen  路  4Comments

npetitclerc picture npetitclerc  路  4Comments

pleabargain picture pleabargain  路  5Comments

nickpollari picture nickpollari  路  5Comments