Skip to content
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

FileDownload widget can't get disabled=False once created with disabled=True #1820

Closed
hugocatlas opened this issue Nov 30, 2020 · 1 comment
Milestone

Comments

@hugocatlas
Copy link

Dear Panel team,

I'm facing an issue with the new FileDownload widget which I believe to be a bug, unless I'm doing a bad utilization of it. For info, I'm using Panel version 0.10.2.

Consider the following MWE:

import time
import panel as pn
pn.extension()

log_download1 = pn.widgets.FileDownload(button_type='success', label='Download log', disabled=True)

log_download2 = pn.widgets.Button(button_type='success', name='Download log', disabled=True)

def enable_button(button_obj):
    for i in range(5):
        time.sleep(1)
        if i == 3:
            button_obj.disabled = False

#then compare 
enable_button(button_obj=log_download1)

#against 
enable_button(button_obj=log_download2)

Upon calling enable_button on log_download1 (FileDownload widget), the button won't get enabled when i == 3. Making the same for log_download2 (Button widget) works as expected: the button is created disabled and it gets enabled if a given condition is met. It is unfortunate if the same behavior can't be obtained using FileDownload since in my use case, I need to make the download available only when a given flag is found in a log file.

Hope it helps.

Thanks in advance,

Hugo

@rafgonsi
Copy link

rafgonsi commented Dec 9, 2020

Hello,

I experienced similar issue with panel 0.9.7. It seems that the button gets enabled (at least in a sense that its disabled values is set to False), although this change is not visible. See gif below:

Peek 2020-12-08 17-17

See the discussion and possible workaround here
https://discourse.holoviz.org/t/filedownload-widget-does-not-disable-enable-correctly/1523

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

No branches or pull requests

3 participants