adding song while text in search field resets and appends song

This commit is contained in:
Chris Cochrun 2023-02-18 06:52:52 -06:00
parent f1ea742453
commit 6a0fb02c52

View file

@ -122,10 +122,10 @@ Item {
Kirigami.Action { Kirigami.Action {
displayComponent: Component { displayComponent: Component {
Kirigami.SearchField { Kirigami.SearchField {
id: searchField id: songSearchField
height: parent.height height: parent.height
width: parent.width - 40 width: parent.width - 40
onAccepted: songProxyModel.setFilterRegularExpression(searchField.text) onAccepted: songProxyModel.setFilterRegularExpression(songSearchField.text)
} }
} }
/* visible: selectedLibrary == "songs" */ /* visible: selectedLibrary == "songs" */
@ -313,6 +313,7 @@ Item {
function newSong() { function newSong() {
songProxyModel.songModel.newSong(); songProxyModel.songModel.newSong();
songSearchField.clear();
songLibraryList.currentIndex = songProxyModel.songModel.rowCount() - 1; songLibraryList.currentIndex = songProxyModel.songModel.rowCount() - 1;
if (!editMode) if (!editMode)
editMode = true; editMode = true;