-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[0.63.1][Android 5] underlineColorAndroid not transparent #29379
Comments
HI @Bardiamist, thanks for the issue. I did a quick check on Android 5 and I cannot seem to reproduce this. Do you have any more details so I could reproduce this? |
@safaiyeh Yes, I tried now on same simulator (Nexus 5 API 22) this is Andoid 5.1 and no issue here. |
Yup, was able to reproduce this on Android 5. I'll bring this up |
Maybe is logging this exception? Line 537 in 9f699ae
|
No, I see many Logcat``` 07-16 15:45:44.460 5742-5742/? E/libprocessgroup: failed to make and chown /acct/uid_10061: Read-only file system 07-16 15:45:44.460 5742-5742/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT? 07-16 15:45:44.461 5742-5742/? I/art: Not late-enabling -Xcheck:jni (already on) 07-16 15:45:44.510 5742-5742/com.underline D/SoLoader: init start 07-16 15:45:44.511 5742-5742/com.underline D/SoLoader: adding system library source: /vendor/lib 07-16 15:45:44.511 5742-5742/com.underline D/SoLoader: adding system library source: /system/lib 07-16 15:45:44.511 5742-5742/com.underline D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.underline-1/lib/x86 flags = 0] 07-16 15:45:44.512 5742-5742/com.underline D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.underline/lib-main flags = 1] 07-16 15:45:44.513 5742-5742/com.underline D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2] 07-16 15:45:44.513 5742-5742/com.underline D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/vendor/lib flags = 2] 07-16 15:45:44.513 5742-5742/com.underline D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.underline-1/lib/x86 flags = 0] 07-16 15:45:44.513 5742-5742/com.underline D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.underline/lib-main flags = 1] 07-16 15:45:44.516 5742-5742/com.underline V/fb-UnpackingSoSource: locked dso store /data/data/com.underline/lib-main 07-16 15:45:44.516 5742-5742/com.underline I/fb-UnpackingSoSource: dso store is up-to-date: /data/data/com.underline/lib-main 07-16 15:45:44.516 5742-5742/com.underline V/fb-UnpackingSoSource: releasing dso store lock for /data/data/com.underline/lib-main 07-16 15:45:44.516 5742-5742/com.underline D/SoLoader: init finish: 4 SO sources prepared 07-16 15:45:44.516 5742-5742/com.underline D/SoLoader: init exiting 07-16 15:45:44.519 5742-5742/com.underline D/SoLoader: init exiting 07-16 15:45:44.519 5742-5742/com.underline D/SoLoader: About to load: libjscexecutor.so 07-16 15:45:44.520 5742-5742/com.underline D/SoLoader: libjscexecutor.so not found on /data/data/com.underline/lib-main 07-16 15:45:44.520 5742-5742/com.underline D/SoLoader: libjscexecutor.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:44.520 5742-5742/com.underline D/SoLoader: Not resolving dependencies for libjscexecutor.so 07-16 15:45:44.524 5742-5742/com.underline D/JavaScriptCore.Version: 245459.0.0 07-16 15:45:44.525 5742-5742/com.underline D/SoLoader: Loaded: libjscexecutor.so 07-16 15:45:44.526 5742-5742/com.underline D/SoLoader: init exiting 07-16 15:45:44.588 5742-5766/com.underline D/SoLoader: About to load: libfbjni.so 07-16 15:45:44.588 5742-5766/com.underline D/SoLoader: libfbjni.so not found on /data/data/com.underline/lib-main 07-16 15:45:44.588 5742-5766/com.underline D/SoLoader: libfbjni.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:44.588 5742-5766/com.underline D/SoLoader: Not resolving dependencies for libfbjni.so 07-16 15:45:44.594 5742-5766/com.underline D/SoLoader: Loaded: libfbjni.so 07-16 15:45:44.594 5742-5766/com.underline D/SoLoader: About to load: libflipper.so 07-16 15:45:44.594 5742-5766/com.underline D/SoLoader: libflipper.so not found on /data/data/com.underline/lib-main 07-16 15:45:44.594 5742-5766/com.underline D/SoLoader: libflipper.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:44.594 5742-5766/com.underline D/SoLoader: Not resolving dependencies for libflipper.so 07-16 15:45:44.600 5742-5766/com.underline D/SoLoader: Loaded: libflipper.so 07-16 15:45:44.624 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin Inspector 07-16 15:45:44.625 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin React 07-16 15:45:44.635 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin Databases 07-16 15:45:44.636 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin Preferences 07-16 15:45:44.637 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin CrashReporter 07-16 15:45:44.641 5742-5742/com.underline I/flipper: flipper: FlipperClient::addPlugin Network 07-16 15:45:44.710 5742-5742/com.underline W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 07-16 15:45:44.738 5742-5742/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:44.738 5742-5742/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:44.744 5742-5757/com.underline W/art: Suspending all threads took: 5.409ms 07-16 15:45:44.746 5742-5757/com.underline I/art: Background partial concurrent mark sweep GC freed 1097(82KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 1951KB/3MB, paused 6.222ms total 23.613ms 07-16 15:45:44.757 5742-5780/com.underline D/OpenGLRenderer: Render dirty regions requested: true 07-16 15:45:44.759 5742-5742/com.underline D/Atlas: Validating map... 07-16 15:45:44.765 5742-5742/com.underline W/unknown:ReactNative: Packager connection already open, nooping. 07-16 15:45:44.787 5742-5780/com.underline I/OpenGLRenderer: Initialized EGL, version 1.4 07-16 15:45:44.787 5742-5780/com.underline W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 07-16 15:45:44.789 5742-5780/com.underline D/EGL_emulation: eglCreateContext: 0xa51470a0: maj 3 min 0 rcv 3 07-16 15:45:44.790 5742-5780/com.underline D/EGL_emulation: eglMakeCurrent: 0xa51470a0: ver 3 0 (tinfo 0xa5116700) 07-16 15:45:44.790 5742-5780/com.underline E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf 07-16 15:45:44.791 5742-5780/com.underline E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824 07-16 15:45:44.793 5742-5780/com.underline D/OpenGLRenderer: Enabling debug mode 0 07-16 15:45:44.798 5742-5780/com.underline D/EGL_emulation: eglMakeCurrent: 0xa51470a0: ver 3 0 (tinfo 0xa5116700) 07-16 15:45:44.906 5742-5780/com.underline D/EGL_emulation: eglMakeCurrent: 0xa51470a0: ver 3 0 (tinfo 0xa5116700) 07-16 15:45:45.005 5742-5781/com.underline D/SoLoader: About to load: libreactnativejni.so 07-16 15:45:45.005 5742-5781/com.underline D/SoLoader: libreactnativejni.so not found on /data/data/com.underline/lib-main 07-16 15:45:45.005 5742-5781/com.underline D/SoLoader: libreactnativejni.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:45.005 5742-5781/com.underline D/SoLoader: Not resolving dependencies for libreactnativejni.so 07-16 15:45:45.006 5742-5781/com.underline D/SoLoader: Loaded: libreactnativejni.so 07-16 15:45:45.019 5742-5781/com.underline E/unknown:ReactNative: ReactInstanceManager.createReactContext: mJSIModulePackage null 07-16 15:45:45.023 5742-5783/com.underline E/unknown:ReactNative: ReactInstanceManager.attachRootViewToInstance() 07-16 15:45:45.023 5742-5742/com.underline W/unknown:ReactNative: Packager connection already open, nooping. 07-16 15:45:45.046 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager 07-16 15:45:45.046 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode 07-16 15:45:45.047 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager 07-16 15:45:45.048 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode 07-16 15:45:45.049 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager 07-16 15:45:45.049 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode 07-16 15:45:45.049 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager 07-16 15:45:45.051 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode 07-16 15:45:45.053 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager 07-16 15:45:45.056 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager 07-16 15:45:45.060 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager 07-16 15:45:45.061 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager 07-16 15:45:45.063 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager 07-16 15:45:45.064 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager 07-16 15:45:45.065 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode 07-16 15:45:45.067 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager 07-16 15:45:45.068 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager 07-16 15:45:45.069 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode 07-16 15:45:45.069 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager 07-16 15:45:45.073 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode 07-16 15:45:45.074 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager 07-16 15:45:45.077 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager 07-16 15:45:45.078 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode 07-16 15:45:45.079 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager 07-16 15:45:45.079 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode 07-16 15:45:45.080 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager 07-16 15:45:45.082 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager 07-16 15:45:45.086 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode 07-16 15:45:45.087 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager 07-16 15:45:45.088 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode 07-16 15:45:45.088 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager 07-16 15:45:45.090 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode 07-16 15:45:45.091 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager 07-16 15:45:45.092 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode 07-16 15:45:45.092 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager 07-16 15:45:45.093 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager 07-16 15:45:45.095 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager 07-16 15:45:45.095 5742-5783/com.underline W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode 07-16 15:45:45.099 5742-5783/com.underline D/SoLoader: About to load: libyoga.so 07-16 15:45:45.099 5742-5783/com.underline D/SoLoader: libyoga.so not found on /data/data/com.underline/lib-main 07-16 15:45:45.099 5742-5783/com.underline D/SoLoader: libyoga.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:45.099 5742-5783/com.underline D/SoLoader: Not resolving dependencies for libyoga.so 07-16 15:45:45.103 5742-5783/com.underline D/SoLoader: Loaded: libyoga.so 07-16 15:45:45.106 5742-5783/com.underline E/unknown:ReactRootView: runApplication: call AppRegistry.runApplication 07-16 15:45:45.117 5742-5783/com.underline I/flipper: flipper: FlipperClient::addPlugin Fresco 07-16 15:45:45.154 5742-5742/com.underline E/unknown:ReactNative: ReactInstanceManager.attachRootViewToInstance() 07-16 15:45:45.154 5742-5742/com.underline E/unknown:ReactRootView: runApplication: call AppRegistry.runApplication 07-16 15:45:45.192 5742-5782/com.underline D/SoLoader: About to load: libreactnativeblob.so 07-16 15:45:45.192 5742-5782/com.underline D/SoLoader: libreactnativeblob.so not found on /data/data/com.underline/lib-main 07-16 15:45:45.192 5742-5782/com.underline D/SoLoader: libreactnativeblob.so found on /data/app/com.underline-1/lib/x86 07-16 15:45:45.192 5742-5782/com.underline D/SoLoader: Not resolving dependencies for libreactnativeblob.so 07-16 15:45:45.192 5742-5782/com.underline D/SoLoader: Loaded: libreactnativeblob.so 07-16 15:45:45.229 5742-5783/com.underline I/WebViewFactory: Loading com.google.android.webview version 77.0.3865.92 (code 386509215) 07-16 15:45:45.251 5742-5783/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:45.251 5742-5783/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:45.252 5742-5783/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:45.252 5742-5783/com.underline I/art: Rejecting re-init on previously-failed class java.lang.Class 07-16 15:45:45.276 5742-5783/com.underline I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 644-645) 07-16 15:45:45.291 5742-5783/com.underline I/chromium: [INFO:library_loader_hooks.cc(51)] Chromium logging enabled: level = 0, default verbosity = 0 07-16 15:45:45.291 5742-5783/com.underline I/cr_LibraryLoader: Expected native library version number "77.0.3865.92", actual native library version number "77.0.3865.92" 07-16 15:45:45.509 5742-5782/com.underline I/ReactNativeJS: Running "underline" with {"rootTag":1} 07-16 15:45:45.591 5742-5780/com.underline D/EGL_emulation: eglMakeCurrent: 0xa51470a0: ver 3 0 (tinfo 0xa5116700) ```Possible to hide underline by
but on focus/unfocus |
Any fix/patch/workaround? |
@safaiyeh - What's the status on this bug? |
@badikumar no activity, PRs are welcome! |
same problem |
me too |
1 similar comment
me too |
+1 |
Same thing here with Expo managed workflow, and it started after i upgrade expo sdk from 38 to 39, that upgrade react-native from 0.62 to 0.63 "expo": "^39.0.0", |
I found a workaround: it seems that it should be given a <TextInput
style={{
fontSize: 16,
flex: 1,
borderBottomColor: 'transparent',
}}
underlineColorAndroid={'transparent'}
/> |
@ksti Still not working for me :( |
setting the border bottom width to 0 along with the underlineColorAndroid to transparent worked for me. I tested this using a android 5.0 emulator 4.7 WXGA Android 21 on react native 0.63.1 |
After updating to RN0.63 I can confirm that the It appears to me that the Is anybody still using |
Summary: `underlineColorAndroid` no longer seems to work. It only matters for devices with API level 21 (Android 5.0) and lower, but the property appears to have no effect. More details on this [React Native GitHub issue](facebook/react-native#29379). Test Plan: I tested each callsite individually on API levels 21, 22, 23, and 29. Most of them needed to be replaced with the `borderBottomColor: 'transparent'` style, but two (`Entry` and `ChatInputBar`) did not seem to have issues. Reviewers: palys-swm Subscribers: KatPo, zrebcu411, Adrian Differential Revision: https://phabricator.ashoat.com/D320
Hi @Ashoat you means you solve this issue?I have same issue on android api 10 |
my react-native:0.59.8,must upgrade to 0.63? |
I'm in 0.63.4, either Edit: |
Hello ReactNative Developers! 😃 I just prepared Pull Request #30897 that seems to solve this issue You can contact me by email at [email protected] Please head over to the Pull Request #30897 and thumbs up if you like it. If you don't like the pr please feel free to leave a code review or comment, I'll be happy to add improvements and changes. Thanks a lot 🙏 ☮️ 🏖️ |
Tried underlineColorAndroid='transparent' |
Same... |
Summary: This issue fixes facebook#29379 `underlineColorAndroid'='transparent'` does not work on Android API 21. Setting `style: { bottomBorderColor: 'transparent'}` fixes the issue. The following steps fix underlineColorAndroid on Android API 21: - Store the bottomBorderColor in a local variable - Then set the bottomBorderColor to the same color of underlineColorAndroid - Set underlineColorAndroid - Then Set the bottomBorderColor to the previous color previously stored in the local variable This change requires `ReactViewBackgroundDrawable` method `getBorderColor` to be public and accessible from `ReactTextInputManager` to retrieve the border color. https://github.com/facebook/react-native/blob/6061b7928320c64a94716ce3d6646667ebf3f6b5/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java#L1231-L1236 Related Discussions facebook#18938 facebook#18988 facebook#29412 (comment) More Information at fabOnReact/react-native-notes#4 (comment) ## Changelog [Android] [Fixed] - Fix underlineColorAndroid transparent not working on API 21 Pull Request resolved: facebook#30897 Test Plan: This changes fix the Java API which can not be tested as explained in commit facebook@709a441 The java TextInputTest was excluded from the test suite in commit facebook@709a441 as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 21</summary>** <p> Does not show underline by default (`transparent`) ```javascript <TextInput /> ``` <image src="https://user-images.githubusercontent.com/24992535/107060953-dee34d00-67d7-11eb-8f01-360dbb1420b8.png" width="150" /> ```javascript <TextInput underlineColorAndroid="red" /> ``` <image src="https://user-images.githubusercontent.com/24992535/107061134-194cea00-67d8-11eb-9da1-9780b1aa8294.png" width="150" /> ```javascript <TextInput underlineColorAndroid="green" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4 } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107062411-9167df80-67d9-11eb-810c-749992d8d2d3.png" width="150" /> ```javascript <TextInput style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4 } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107062735-e6a3f100-67d9-11eb-93c3-02cd768f8421.png" width="150" /> ```javascript <TextInput underlineColorAndroid="blue" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4, borderLeftColor: 'pink', borderLeftWidth: 7, borderRightColor: 'yellow', borderRightWidth: 7, } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107063263-75b10900-67da-11eb-97ab-316736d525a2.png" width="150" /> ```javascript <TextInput underlineColorAndroid="transparent" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4, borderLeftColor: 'pink', borderLeftWidth: 7, borderRightColor: 'yellow', borderRightWidth: 7, } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107063332-8792ac00-67da-11eb-82fc-99793bf4d49d.png" width="150" /> </p> </details> Reviewed By: cortinico Differential Revision: D33906415 Pulled By: lunaleaps fbshipit-source-id: bd7efe4aac40ad701aec83f051ac40dcd4a99cda
Summary: This issue fixes facebook#29379 `underlineColorAndroid'='transparent'` does not work on Android API 21. Setting `style: { bottomBorderColor: 'transparent'}` fixes the issue. The following steps fix underlineColorAndroid on Android API 21: - Store the bottomBorderColor in a local variable - Then set the bottomBorderColor to the same color of underlineColorAndroid - Set underlineColorAndroid - Then Set the bottomBorderColor to the previous color previously stored in the local variable This change requires `ReactViewBackgroundDrawable` method `getBorderColor` to be public and accessible from `ReactTextInputManager` to retrieve the border color. https://github.com/facebook/react-native/blob/6061b7928320c64a94716ce3d6646667ebf3f6b5/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java#L1231-L1236 Related Discussions facebook#18938 facebook#18988 facebook#29412 (comment) More Information at fabOnReact/react-native-notes#4 (comment) ## Changelog [Android] [Fixed] - Fix underlineColorAndroid transparent not working on API 21 Pull Request resolved: facebook#30897 Test Plan: This changes fix the Java API which can not be tested as explained in commit facebook@709a441 The java TextInputTest was excluded from the test suite in commit facebook@709a441 as they need the Yoga libraries to run **<details><summary>CLICK TO OPEN TESTS RESULTS - API 21</summary>** <p> Does not show underline by default (`transparent`) ```javascript <TextInput /> ``` <image src="https://user-images.githubusercontent.com/24992535/107060953-dee34d00-67d7-11eb-8f01-360dbb1420b8.png" width="150" /> ```javascript <TextInput underlineColorAndroid="red" /> ``` <image src="https://user-images.githubusercontent.com/24992535/107061134-194cea00-67d8-11eb-9da1-9780b1aa8294.png" width="150" /> ```javascript <TextInput underlineColorAndroid="green" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4 } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107062411-9167df80-67d9-11eb-810c-749992d8d2d3.png" width="150" /> ```javascript <TextInput style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4 } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107062735-e6a3f100-67d9-11eb-93c3-02cd768f8421.png" width="150" /> ```javascript <TextInput underlineColorAndroid="blue" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4, borderLeftColor: 'pink', borderLeftWidth: 7, borderRightColor: 'yellow', borderRightWidth: 7, } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107063263-75b10900-67da-11eb-97ab-316736d525a2.png" width="150" /> ```javascript <TextInput underlineColorAndroid="transparent" style={ { borderBottomColor: 'red', borderBottomWidth: 2, borderTopColor: 'black', borderTopWidth: 4, borderLeftColor: 'pink', borderLeftWidth: 7, borderRightColor: 'yellow', borderRightWidth: 7, } } /> ``` <image src="https://user-images.githubusercontent.com/24992535/107063332-8792ac00-67da-11eb-82fc-99793bf4d49d.png" width="150" /> </p> </details> Reviewed By: cortinico Differential Revision: D33906415 Pulled By: lunaleaps fbshipit-source-id: bd7efe4aac40ad701aec83f051ac40dcd4a99cda
Description
I updated from
0.62.2
to0.63.1
andTextInput
on Android 5 has underline now.underlineColorAndroid="transparent"
does not help.Android 6 and above hasn't underline.
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
npx react-native init underline
<TextInput />
Expected Results
TextInput underline shouldn't be rendered.
Code example:
Screenshot
The text was updated successfully, but these errors were encountered: