Skip to content

Commit cb843dc

Browse files
liveHarshitiamareebjamal
authored andcommitted
fix: Back button in location fragment (#2039)
1 parent 1239af7 commit cb843dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/org/fossasia/openevent/general/search/location/SearchLocationFragment.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.fossasia.openevent.general.search.location
33
import android.Manifest
44
import android.content.pm.PackageManager
55
import android.os.Bundle
6+
import android.view.KeyEvent
67
import android.view.LayoutInflater
78
import android.view.View
89
import android.view.ViewGroup
@@ -195,6 +196,11 @@ class SearchLocationFragment : Fragment() {
195196
return false
196197
}
197198
})
199+
rootView.locationSearchView.locationSearchView.setOnKeyListener { _, keyCode, _ ->
200+
if (keyCode == KeyEvent.KEYCODE_BACK)
201+
rootView.locationSearchView.clearFocus()
202+
true
203+
}
198204
searchLocationViewModel.handlePlaceSuggestions(subject)
199205
}
200206

0 commit comments

Comments
 (0)