Open pierrotsmnrd opened 4 days ago
This issue has been mentioned on HoloViz Discourse. There might be relevant details there:
Adding self.link
here will also solve the issue.
self.link(self._selector, size='size', visible='visible')
self.link(self._nav_bar, visible='visible')
I think the underlying widgets have never been synced. This is only really a problem with the False to True combination.
file_selector = pn.widgets.FileSelector(visible=False)
print(file_selector._composite.visible, [f.visible for f in file_selector._composite])
file_selector = pn.widgets.FileSelector(visible=True)
print(file_selector._composite.visible, [f.visible for f in file_selector._composite])
file_selector = pn.widgets.FileSelector(visible=False)
file_selector.visible = True
print(file_selector._composite.visible, [f.visible for f in file_selector._composite])
file_selector = pn.widgets.FileSelector(visible=True)
file_selector.visible = False
print(file_selector._composite.visible, [f.visible for f in file_selector._composite])
False [False, True, False] # False, all should be false, but do not matter as everything is hidden)
True [True, True, True] # True, works as intended
True [False, True, False] # False -> True, Everything should be hidden - the bad combination
False [True, True, True] # True -> False, all should be false, but do not matter as everything is hidden
ALL software version info
Software Version Info
```plaintext panel==1.5.4 MacOS 14.6.1 ```Description of expected behavior and the observed behavior
visible=False
visible
property is set toTrue
Complete, minimal, self-contained example code that reproduces the issue
Diagnostic
FileSelector is a composite widget. After investigating the HTML structure, it appears that several components inside the
_composite
property remain withvisible=False
despite setting theFileSelector
'svisible
property toTrue
Workaround
Updating the
toggle_visibility
function to this illustrates the diagnostic and gives the expected behaviorStack traceback and/or browser JavaScript console output
None
Screenshots or screencasts of the bug in action
https://github.com/user-attachments/assets/8855d4f7-60ce-4f1d-ab11-9ae15b21dede