react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

TextInput inside Portal behaves incorrectly when using CJK keyboard

Open suregi opened this issue 3 years ago • 5 comments

Current behaviour

If you type ㅁ ㅏ ㅇ in Korean keyboard, it shows up as ㅁ ㅏ ㅇ

Expected behaviour

It should show up as 망

Code sample

import React from 'react';
import { View } from 'react-native';
import { Portal, Provider, TextInput } from 'react-native-paper';

const App = () => {
	const [val, setVal] = React.useState('');
	const [val2, setVal2] = React.useState('');

	return (
		<Provider>
			<Portal>
				<TextInput
					placeholder={
						'ㅁ ㅏ ㅇ will show up instead of 망' /* when typing ㅁ ㅏ ㅇ in Korean keyboard, it should show up as 망  */
					}
					value={val}
					onChangeText={setVal}
				/>
			</Portal>

			<View style={{ flex: 1, justifyContent: 'center' }}>
				<TextInput
					placeholder={
						'망 will show up correctly' /* outside of Portal, it correctly shows up as 망  */
					}
					value={val2}
					onChangeText={setVal2}
				/>
			</View>
		</Provider>
	);
};

What have you tried

It also happens in older version 4.7.2.

It is most likely to happen with other keyboards such as Japanese or Chinese.

Your Environment

software version
ios or android Android 12
react-native 0.64
react-native-paper 4.11.2
node 14.15.0

suregi avatar Feb 22 '22 23:02 suregi

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-vector-icons

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

github-actions[bot] avatar Feb 22 '22 23:02 github-actions[bot]

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

github-actions[bot] avatar Feb 22 '22 23:02 github-actions[bot]

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

github-actions[bot] avatar Mar 25 '22 02:03 github-actions[bot]

Repro attached here

Please test with Android device and use Korean keyboard. I suppose that you can repro with other CJK keyboard such as Japanese and Chinese also, but I haven't tried myself.

suregi avatar Mar 28 '22 21:03 suregi

I have the same issue.

nappa0326 avatar Jul 06 '22 15:07 nappa0326

There is an issue with inputs within portals in general, not only in the paper library. Within the other issue you can find the workaround.

Please also check that approach which can be helpful.

Created a handy snack for you

lukewalczak avatar Aug 22 '22 14:08 lukewalczak