deephaven / deephaven-plugins

Deephaven Plugins
11 stars 14 forks source link

TextField min width behaviour #571

Open ethanalvizo opened 3 months ago

ethanalvizo commented 3 months ago

Description TextField component seems to have it's own minimum width defined. When put inside a grid container it will not shrink to the same size as expected

Steps to reproduce

  1. Paste code below into terminal

    
    from deephaven import ui
    @ui.component
    def my_input():
    text, set_text = ui.use_state("hello")
    count, set_count = ui.use_state(0)
    
    return ui.grid(
        ui.action_button(
            f"You pressed me {count} times", on_press=lambda _: set_count(count + 1)
        ),
        ui.text_field(value=text, on_change=set_text),
        ui.text(f"You typed {text}"),
        rows="100px 10px 10px",
        columns="10px"
    )

result = my_input()



**Expected results**
Component matches width of grid
<!-- 
What you expected to happen. Index it by the steps to reproduce to make it clear, e.g.

3. New page to load
-->

**Actual results**
Component retains a larger width despite being inside a grid container of a smaller size
<!-- 
What actually happened. Index it by the steps to reproduce to make it clear, e.g.

3. New page did not load
-->

**Additional details and attachments**
Discovered in https://github.com/deephaven/deephaven-plugins/pull/552
<!-- If applicable, add any additional screenshots, logs, or other attachments to help explain your problem. -->

**Versions**

<!-- Version information. These versions can be copied from the Settings panel in the Deephaven UI. -->
 - Engine Version: ...
 - Web UI Version: ...
 - Java Version: ...
 - Barrage Version: ...
 - OS: ...
 - Browser: ...
 - Docker: ...
mofojed commented 3 months ago

Same with Pickers and such. Not sure how we want to handle these fields in a grid.