feat(hashtag-column): handle new hashtag on Enter key press

This commit is contained in:
Fernando López Guevara
2025-05-27 16:50:37 -03:00
parent ee85b754dd
commit 3972f5f2ab

View File

@@ -763,10 +763,17 @@ pub fn hashtag_ui(
ui.add(text_edit); ui.add(text_edit);
ui.add_space(8.0); ui.add_space(8.0);
if ui
.add_sized(egui::vec2(50.0, 40.0), add_column_button()) let mut handle_user_input = false;
.clicked() if ui.input(|i| i.key_released(egui::Key::Enter))
|| ui
.add_sized(egui::vec2(50.0, 40.0), add_column_button())
.clicked()
{ {
handle_user_input = true;
}
if handle_user_input && !text_buffer.is_empty() {
let resp = let resp =
AddColumnResponse::Timeline(TimelineKind::Hashtag(sanitize_hashtag(text_buffer))); AddColumnResponse::Timeline(TimelineKind::Hashtag(sanitize_hashtag(text_buffer)));
id_string_map.remove(&id); id_string_map.remove(&id);