Skip to content
Discussion options

You must be logged in to vote

You are not misunderstanding the API. Your ListDelegate and state wiring are correct. The list is not visible due to a layout sizing issue, which is expected behavior in GPUI.


Root Cause

In GPUI, widgets do not auto-size. A component only renders if its parent provides a concrete size.

In your case:

div().child(gpui_component::list::List::new(&self.state))
  • div() has no height or flex rules
  • List does not define its own height
  • Layout resolves to 0px height, so nothing is drawn

This happens silently (no warnings or panics).


Fix (Recommended)

Give the container and the list a size using flex layout.

Corrected Render Implementation

impl gpui::Render for MyList {
    fn render(
        &mut s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by babakou
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants