Skip to content

Commit d094e2f

Browse files
chore: fix single line problem (#8)
1 parent 3a90b00 commit d094e2f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

android/src/main/java/com/textinput/TextInputView.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,24 @@ import androidx.annotation.Nullable
1010
import com.facebook.react.uimanager.UIManagerHelper
1111
import com.facebook.react.views.textinput.ReactEditText
1212
import so.onekey.app.wallet.pasteinput.PasteWatcher
13+
import android.view.Gravity
1314

1415
class TextInputView(context: Context) : ReactEditText(context) {
1516

1617
private var mPasteWatcher: PasteWatcher? = null
1718

19+
init {
20+
includeFontPadding = false
21+
}
22+
23+
override fun scrollTo(x: Int, y: Int) {
24+
if (gravity and Gravity.VERTICAL_GRAVITY_MASK == Gravity.CENTER_VERTICAL) {
25+
super.scrollTo(x, 0)
26+
} else {
27+
super.scrollTo(x, y)
28+
}
29+
}
30+
1831
override fun onTextContextMenuItem(id: Int): Boolean {
1932
if (id == android.R.id.paste || id == android.R.id.pasteAsPlainText) {
2033
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onekeyfe/react-native-text-input",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"description": "text-input",
55
"source": "./src/index.tsx",
66
"types": "./lib/typescript/src/index.d.ts",

0 commit comments

Comments
 (0)