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

Updating path on a File/MultiFileSelector Parameter updates objects #814

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Aug 3, 2023

Fixes #545
Supersedes #546

The issue stated about FileSelector:

FileSelector behaves like Selector and should as such set its value to the first item of objects, objects being the result of a glob on path.

This has been addressed in #801.

About MultiFileSelector:

Also the docs currently state that the default value is all of the matched files, but in practice it's None.

While that's what the docs say, the behavior of ListSelector from which MultiFileSelector inherits is for default to be None so I'm not sure we should make this change without also updating ListSelector. Also, Panel maps the MultiFileSelector parameter to the FileSelector widget (the FileSelector Parameter being mapped to a simple Select or TextInput widget) and I don't think we'd want all the files to be selected by default.

import param

class P(param.Parameterized):
    ls = param.ListSelector(objects=[1, 2, 3])

a = A()

assert a.ls is None

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@maximlt maximlt merged commit 7175b37 into main Aug 21, 2023
@maximlt maximlt deleted the path_update_objects branch August 21, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants