Skip to content

Commit 1d908a3

Browse files
authored
Workaround crash in ModalNavigationDrawer when closing during selection (#10756)
1 parent f39219a commit 1d908a3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ui-libraries/material/src/ui/components/navigation_drawer.slint

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ export component ModalNavigationDrawer inherits ModalDrawer {
189189
// accessible-label: root.title;
190190
accessible-item-count: root.groups.length;
191191

192+
// Workaround for issue #9766
193+
close_timer := Timer {
194+
interval: 0ms;
195+
running: false;
196+
triggered => {
197+
root.close();
198+
self.stop();
199+
}
200+
}
201+
192202
for group[group_index] in root.groups : NavigationGroupTemplate {
193203
title: group.title;
194204
items: group.items;
@@ -207,7 +217,7 @@ export component ModalNavigationDrawer inherits ModalDrawer {
207217

208218
root.current_group = group_index;
209219
root.current_index = item_index;
210-
root.close();
211220
root.selected(group_index, item_index);
221+
close_timer.start();
212222
}
213223
}

0 commit comments

Comments
 (0)