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

Typing for label prop on many components is incorrect #988

Open
mofojed opened this issue Nov 5, 2024 · 0 comments
Open

Typing for label prop on many components is incorrect #988

mofojed opened this issue Nov 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Nov 5, 2024

Description

There are a number of components that define label prop as Element | None. That does not allow a str or other primitive types. In Spectrum though, they accept a ReactNode which does accept a string, number, boolean, etc.

Some components with incorrect typing:

  • combo_box
  • date_field
  • date_picker
  • date_range_picker
  • picker
  • progress_bar
  • time_field

I'm pretty sure all of these can accept text and other primitives. Should be verified.

Steps to reproduce

  1. Enter the following snippet in a code editor:
from deephaven import ui


p = ui.picker("Hello", "World", label="Picker label")

Expected results

  1. There should be no type hint errors

Actual results

  1. There is a type error reported (though running the code does work okay):
    image

Versions
Engine Version: 0.36.1
Web UI Version: 0.97.0
Java Version: 11.0.24
Barrage Version: 0.6.0
Browser Name: Firefox 131
OS Name: Linux
matplotlib: 0.0.0
plotly-express: 0.0.0
auth-keycloak: 0.0.0
ui: 0.0.0
example-theme: 0.0.0

@mofojed mofojed added bug Something isn't working triage labels Nov 5, 2024
@vbabich vbabich removed the triage label Nov 5, 2024
@vbabich vbabich added this to the November 2024 milestone Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants