You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case: when I'm displaying a ListDialog with dynamic data, the dialog does not recompose when the data changes.
It will be great to have a function to refresh the dialog, or much better to have the dialog recompose when data is changed.
current workaround:
val listDialog = rememberMaterialDialogState()
val scope = rememberCoroutineScope()
LaunchedEffect(list) {
// If the list changes when the dialog is open, we should refresh the dialog manually
// by closing and opening it again
if (listDialog.showing) {
listDialog.hide()
scope.launch {
// this won't work without adding delay
delay(50)
listDialog.show()
}
}
}
MaterialDialog(dialogState = listDialog) {
listItems(list = list) { index, value ->
// do something
}
}
The text was updated successfully, but these errors were encountered:
I don't seem to be seeing this behaviour as when I add to the list it recomposes immediately. Do you mind providing a code example with the changing state in it?
I have a case: when I'm displaying a
ListDialog
with dynamic data, the dialog does not recompose when the data changes.It will be great to have a function to refresh the dialog, or much better to have the dialog recompose when data is changed.
current workaround:
The text was updated successfully, but these errors were encountered: