Change timing to close command bar

This commit is contained in:
1024jp 2023-11-24 10:18:09 +09:00
parent fe5ac92995
commit f841cf8705
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Change Log
### Fixes
- [beta] Fix an issue that disabled menu items were listed as the quick action candidates.
- [beta] Fix an issue that some actions were not performed properly by the Quick Action.

View File

@ -149,10 +149,13 @@ struct CommandBarView: View {
/// Perform the selected command and close the view.
private func perform() {
// first close the command bar and then take the action
// so that the action is delivered to the correct (first) responder.
self.parent?.close()
if let command = self.candidates.first(where: { $0.id == self.selection })?.command {
command.perform()
}
self.parent?.close()
}
}