1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 23:00:04 -04:00

Fix: assign a different id to each table cell, avoiding id clashes (#4076)

Each cell in a table now has a `Ui` with a unique `Id` based on the row
and column.

This avoids Id-clashes, e.g. when putting a `CollapsingHeader` in a
table cell.
This commit is contained in:
Emil Ernerfeldt
2024-02-20 13:35:19 +01:00
committed by GitHub
parent 68b3ef7f6b
commit a33ae64785
3 changed files with 21 additions and 5 deletions

View File

@@ -194,7 +194,13 @@ impl<'a, 'b> Strip<'a, 'b> {
clip: self.clip,
..Default::default()
};
self.layout.add(flags, width, height, add_contents);
self.layout.add(
flags,
width,
height,
egui::Id::new(self.size_index),
add_contents,
);
}
/// Add an empty cell.