mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-03 18:17:40 -06:00
Delete the KeyChordViewModel if we leave edit mode with no keys (#19778)
There was an issue where if the user adds a new keybinding and then hits "cancel changes", the KeyChordViewModel is left in the keybinding list with an empty value. Nothing gets saved to the json, but visually there was an empty keychord box left behind. This commit fixes that. ## Validation Steps Performed Adding a new keybinding and cancelling changes deletes the keybinding.
This commit is contained in:
parent
c8549bebed
commit
6723ca2239
@ -220,7 +220,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
break;
|
||||
}
|
||||
}
|
||||
actionsPageVM.DeleteKeyChord(args);
|
||||
if (args)
|
||||
{
|
||||
actionsPageVM.DeleteKeyChord(args);
|
||||
}
|
||||
}
|
||||
});
|
||||
kcVM.PropertyChanged([weakThis{ get_weak() }](const IInspectable& sender, const Windows::UI::Xaml::Data::PropertyChangedEventArgs& args) {
|
||||
@ -1032,6 +1035,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// if we're in edit mode, populate the text box with the current keys
|
||||
ProposedKeys(_currentKeys);
|
||||
}
|
||||
else if (!_currentKeys)
|
||||
{
|
||||
// we have left edit mode but don't have any current keys - delete this view model
|
||||
DeleteKeyChord();
|
||||
}
|
||||
}
|
||||
|
||||
void KeyChordViewModel::AcceptChanges()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user