Skip to content
Discussion options

You must be logged in to vote

After experimenting I came up with this solution

fn paint_body(&mut self, ui: &mut Ui) -> InnerResponse<bool> {
        let title_id = ui.id().with(format!("title_{}", self.id.value()));
        let title_has_focus = ui.memory(|m| m.has_focus(title_id));
        ui.add(
            egui::TextEdit::multiline(&mut self.title)
                .desired_rows(1)
                .desired_width(ui.available_width())
                .id(title_id)
                .frame(title_has_focus),
        );
        let description_id = ui.id().with(format!("description_{}", self.id.value()));
        let description_has_focus = ui.memory(|m| m.has_focus(description_id));
        ui.add(
            egui::Te…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Stelios-Kourlis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant