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

StaticText oddities #2669

Closed
maximlt opened this issue Aug 27, 2021 · 0 comments · Fixed by #7038
Closed

StaticText oddities #2669

maximlt opened this issue Aug 27, 2021 · 0 comments · Fixed by #7038
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@maximlt
Copy link
Member

maximlt commented Aug 27, 2021

While having a look at #2663, I noticed a couple of things that could be fixed/clarified about the StaticText widget.

  1. Issue with name parameter of some widgets #1294 already mentions it, if value is not given, the widget doesn't display name. It renders as an empty Div.
  2. The docs say that the accepted type for value is a string, which is what one could expect given the widget's name. However it actually accepts any type (value = param.Parameter(default=None)), and uses the string representation of the object to display it. This can have some undesired consequences, such displaying Title: None for None or Title: for functions (and classes) as they're turned into <function ...></function> in the Div.
  3. Updating value is as simple as st = StaticText(name='Name', value='Bob'); st.value = 'Bill'. But it's also possible to do it with st.value = '<b>Name</b>: John. This is not documented, it's tested however.

I think 1. should be fixed; it might be too late to fix 2. but there could more info in the docs; 3. should not really be supported although it's likely no one has ever used that or will ever do.

@maximlt maximlt added the TRIAGE Default label for untriaged issues label Aug 27, 2021
@philippjfr philippjfr added type: bug Something isn't correct or isn't working and removed TRIAGE Default label for untriaged issues labels Aug 27, 2021
@philippjfr philippjfr added this to the next milestone Feb 17, 2023
@philippjfr philippjfr modified the milestones: next, v1.4.5 Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants