You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text Not Show Content When style both set borderWidth and backgroundColor. #45938
Text Not Show Content When style both set borderWidth and backgroundColor.
if Text style is styles.tag, the '预售' Not Show,only show backgroundColor
else style is styles.tag, the '停止营业' Can show normally
like this
@zdpdsy thanks for update, i see that this is fabric related issue. issue is reproducible on current latest rn 0.74.5 with fabric enabled , i was wrong on previous comment i was on old architecture when i said i was not able to reproduce on 0.74.5 sorry about that
@zdpdsy thanks for update, i see that this is fabric related issue. issue is reproducible on current latest rn 0.74.5 with fabric enabled , i was wrong on previous comment i was on old architecture when i said i was not able to reproduce on 0.74.5 sorry about that
I am looking to map same for Old Architecture. @cortinico Can you help me pointing the code responsible for handling border and backgroundColor for Old Architecture?
This will help me in finding the root cause.
@zdpdsy thanks for update, i see that this is fabric related issue. issue is reproducible on current latest rn 0.74.5 with fabric enabled , i was wrong on previous comment i was on old architecture when i said i was not able to reproduce on 0.74.5 sorry about that
OK,Thanks,i find a temporary solution is change border style To Super element Like as ,like th snapShot:
but this solution is temporary,can't Real problem solving。
text view render with solid border rather than dashed
I also see in the new arch RCTTextView has been replaced by RCTParagraphComponentView with improved logic for border rendering. i see now we render border and background on single CALayer and setting its zIndex to -1024 hopping it would render borderLayer behind the root layer of RCTParagraphComponentView, but it is not , you can verify this by applying some transparency to border layer (zindex works with relative to multiple sublayers). I am not sure issue is with iOS or RN, I believe we might have to reconsider the logic for border and background layer @cortinico since TextView is a extremely important component can we have someone from meta team take a look and suggest a way forward
possible options i see are
move rendering text to new sub layer and add on top of borderLayer
Activity
netmaxt3r commentedon Aug 8, 2024
@zdpdsy issue lists rn version
0.73.9but reproducer is on0.74.5, I am not able to reproduce the issue on reproducer, please confirm from your sidezdpdsy commentedon Aug 9, 2024
@netmaxt3r sorry,i push code now. can you try it again? thank you!

The Result Snapshot is
netmaxt3r commentedon Aug 9, 2024
@zdpdsy thanks for update, i see that this is fabric related issue. issue is reproducible on current latest
rn 0.74.5with fabric enabled , i was wrong on previous comment i was on old architecture when i said i was not able to reproduce on0.74.5sorry about thatcortinico commentedon Aug 9, 2024
Thanks for the confirmation @netmaxt3r
shubhamguptadream11 commentedon Aug 9, 2024
@zdpdsy This is fabric related issue. I'm trying to debug this issue.
In Fabric New Renderer:
https://github.com/facebook/react-native/blob/ee25081d208a69e803f8b1975020b1eb2d897f5a/packages/react-native/React/Views/RCTBorderDrawing.m#L186
This is responsible for drawing backgroundColor and borderWidth styles.
I am looking to map same for Old Architecture. @cortinico Can you help me pointing the code responsible for handling border and backgroundColor for Old Architecture?
This will help me in finding the root cause.
zdpdsy commentedon Aug 9, 2024
OK,Thanks,i find a temporary solution is change border style To Super element Like as ,like th snapShot:
but this solution is temporary,can't Real problem solving。
netmaxt3r commentedon Aug 9, 2024
@shubhamguptadream11 issue might not be on that function , since it is reproducible with dotted border style as well probably with layer zIndex for border layer and main layer.
https://github.com/facebook/react-native/blob/5ced5f8363a8c26bdcf70aa03c6696a681710f4b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L737
netmaxt3r commentedon Aug 9, 2024
I have found one more issue related to this when border width is not specified or computed to zero with dotted style we loose background color
this is due to early return without checking bgcolor https://github.com/facebook/react-native/blob/ee25081d208a69e803f8b1975020b1eb2d897f5a/packages/react-native/React/Views/RCTBorderDrawing.m#L469-L471
shubhamguptadream11 commentedon Aug 9, 2024
@netmaxt3r I found one more issue related to border in Text Component only.
Here: #45925
netmaxt3r commentedon Aug 10, 2024
I did some comparison with old and new arch implementation, i see border styling is not working properly even on old arch
text view render with
solidborder rather thandashedI also see in the new arch
RCTTextViewhas been replaced byRCTParagraphComponentViewwith improved logic for border rendering. i see now we render border and background on singleCALayerand setting itszIndexto-1024hopping it would render borderLayer behind the root layer ofRCTParagraphComponentView, but it is not , you can verify this by applying some transparency to border layer (zindex works with relative to multiple sublayers). I am not sure issue is with iOS or RN, I believe we might have to reconsider the logic for border and background layer@cortinico since
TextViewis a extremely important component can we have someone from meta team take a look and suggest a way forwardpossible options i see are
zhongwuzw commentedon Aug 13, 2024
Any one can try this #45972 ?