Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Selecting languages other than English (Chinese, Korean, Japanese) creates a delay in highlighting #71

Open
sanghaya opened this issue Feb 18, 2021 · 0 comments

Comments

@sanghaya
Copy link

sanghaya commented Feb 18, 2021

Hi, there seems to be a delay in highlighting the non-English languages like Chinese, Korean, and Japanese. The element is not immediately re-rendered unlike English texts.

Reproducible code

const [highlights, setHighlights] = useState([]);


  return (
  <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', marginHorizontal: 10 }}>
	<SelectableText
		menuItems={["Foo", "Bar", "Highlight"]}
		/* 
			Called when the user taps in a item of the selection menu:
			- eventType: (string) is the label
			- content: (string) the selected text portion
			- selectionStart: (int) is the start position of the selected text
			- selectionEnd: (int) is the end position of the selected text
		*/
		onSelection={({ eventType, content, selectionStart, selectionEnd }) => {
			setHighlights([{start: selectionStart, end: selectionEnd}]);
		}}
		highlightColor={'gray'}
		highlights={highlights}
		value="테스트입니다"
		/>
  </View>
)

Expected Behavior

The element should be highlighted immediately.

Any suggestion as to how I can tackle this error? Thanks!

@sanghaya sanghaya changed the title Selecting languages other than English (Chinese, Korean, Japanese) Selecting languages other than English (Chinese, Korean, Japanese) creates a delay in highlighting Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant