Skip to content

Commit 39a540e

Browse files
authored
Temporary fix for crash in focus requester code (#43)
#42
1 parent 8b7a2e3 commit 39a540e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ccp/src/main/java/com/togitech/ccp/component/TogiCountryCodePicker.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ fun TogiCountryCodePicker(
181181
)
182182
onValueChange(country.countryPhoneCode to phoneNumber.text, isNumberValid)
183183
keyboardController?.hide()
184-
focusRequester.freeFocus()
184+
try {
185+
focusRequester.freeFocus()
186+
} catch (exception: IllegalStateException) {
187+
Log.e(TAG, "Unable to free focus ${exception.stackTrace}")
188+
}
185189
},
186190
focusRequester = focusRequester,
187191
)

0 commit comments

Comments
 (0)