From e947fb3e57c5bf2ec34ac98410025d16e3ea48ac Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Sun, 17 Sep 2017 21:59:31 -0700 Subject: [PATCH] Text to Spannable conversion is now using PRIORITY flag to enforce the order of spans Summary: When we convert nested components to Spannable object we must enforce the order of spans somehow, otherwise we will have Spannable object with unpredictable order of spans, which will produce unpredictalbe text layout. We can do it only using `Spannable.SPAN_PRIORITY` feature because Spannable objects do not maintain the order of spans internally. We also have to fix this to implement autoexpandable . Reviewed By: achen1 Differential Revision: D5811172 fbshipit-source-id: 5bc68b869e58aba27d6986581af9fe3343d116a7 --- js/TextExample.android.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/js/TextExample.android.js b/js/TextExample.android.js index b5a61c00e24..17133be48cf 100644 --- a/js/TextExample.android.js +++ b/js/TextExample.android.js @@ -231,6 +231,27 @@ class TextExample extends React.Component<{}> { console.log('1st')}> (Normal text, + + (R)red + + (G)green + + (B)blue + + (C)cyan + + (M)magenta + + (Y)yellow + + (K)black + + + + + + + console.log('2nd')}> (and bold console.log('3rd')}>