Skip to content

Commit

Permalink
Merge pull request #3462 from MerginMaps/fix-project-opening-anr
Browse files Browse the repository at this point in the history
Fix ANR when opening project with searchbar focus
  • Loading branch information
tomasMizera authored May 28, 2024
2 parents c5f123c + 92e08bb commit c567e61
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/qml/project/MMProjectHomeTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ Item {
}

onOpenProjectRequested: function( projectFilePath ) {

//
// There was an issue when closing the projects controller while having the searchbar textField focused
// (not neccessarily with keyboard opened). This is a kind-of workaround and hotfix.
// It might be related to https://bugreports.qt.io/browse/QTBUG-123876 as it started
// to occur more frequently when we upgraded to Qt 6.6.3
//
// See https://github.com/MerginMaps/mobile/issues/3027
//
if ( searchBar.textField.activeFocus ) {
searchBar.textField.focus = false
}

root.openProjectRequested( projectFilePath )
}
onShowLocalChangesRequested: function( projectId ) {
Expand Down
13 changes: 13 additions & 0 deletions app/qml/project/MMProjectServerTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ Item {
}

onOpenProjectRequested: function( projectFilePath ) {

//
// There was an issue when closing the projects controller while having the searchbar textField focused
// (not neccessarily with keyboard opened). This is a kind-of workaround and hotfix.
// It might be related to https://bugreports.qt.io/browse/QTBUG-123876 as it started
// to occur more frequently when we upgraded to Qt 6.6.3
//
// See https://github.com/MerginMaps/mobile/issues/3027
//
if ( searchBar.textField.activeFocus ) {
searchBar.textField.focus = false
}

root.openProjectRequested( projectFilePath )
}
onShowLocalChangesRequested: function( projectId ) {
Expand Down

0 comments on commit c567e61

Please sign in to comment.