Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.content.Intent
import android.content.res.Configuration
import android.os.Bundle
import android.view.KeyEvent
import android.view.inputmethod.InputMethodManager
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
import com.facebook.react.devsupport.DoubleTapReloadRecognizer
Expand Down Expand Up @@ -400,6 +401,11 @@ public open class ReactDelegate {
devSupportManager.showDevOptionsDialog()
return true
}
// A Modal's dialog hands its key-ups on to the activity, whose focused view is never the
// text field in the dialog, so ask the input method whether a text field is taking keys.
if (activity.getSystemService(InputMethodManager::class.java)?.isAcceptingText == true) {
return false
}
val didDoubleTapR = doubleTapReloadRecognizer?.didDoubleTapR(keyCode, activity.currentFocus)
if (didDoubleTapR == true) {
devSupportManager.handleReloadJS()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class DoubleTapReloadRecognizer {
private var doRefresh = false

public fun didDoubleTapR(keyCode: Int, view: View?): Boolean {
if (keyCode == KeyEvent.KEYCODE_R && view !is EditText) {
if (keyCode == KeyEvent.KEYCODE_R && view !is EditText && view?.onCheckIsTextEditor() != true) {
if (doRefresh) {
doRefresh = false
return true
Expand Down
Loading