Set link text color and link underline from JS#1101
Set link text color and link underline from JS#1101marecar3 wants to merge 1 commit intoissue/697_change_color_of_text_and_linksfrom
Conversation
I don't know the details of Aztec implementation in Android, but do we need to do this for links but not for the regular text color? |
Try to move Otherwise we may try redrawing the Aztec editor when linkTextColor is set on the wrapper. |
|
I'll try @daniloercoli 's idea and try to move this PR forward, in an attempt to make it to today's code freeze. |
|
For the release, we opted for a hardcoded setting of the link color #1109 |
In that case, probably we can close this one. |
It is Android update for PR : #1086
With this PR we are allowing JS side to change the link text color on Android, which will also turn on the underline option on the link.
In order to achieve this, I have created a branch on
AztecEditorAndroidrepo with change which allows us to set link style: https://github.com/wordpress-mobile/AztecEditor-Android/compare/fix/make_link_style_publicCurrently, there is a problem with how props are propagated to native code. With this line of code https://github.com/WordPress/gutenberg/pull/16016/files#diff-4828a21853e899e5a36faecfa96d83e8R817 , Android native code will receive
linkTextColorprop aftertextprop, which means it's too late to change link style as text is already drawn on the screen.The only solution that came on my mind was to add
linkTextColoras property intextprop: https://github.com/WordPress/gutenberg/pull/16050/files .@SergioEstevao suggested that we try to set text again when we receive
linkTextColorprop, which I tried and it's working, but I think it's not the best option for Android regarding performance, as we will force to setText on components that don't have a link (aslinkTextColorprop is always passed from JS side) and if we want to set a text only on components that has a link, we would need to check if each component has it which also seems an impact on performance.Let's open discussion here @daniloercoli @hypest , maybe we can figure out a better solution than this.