我的应用程序中的 TextInput 使我的键盘永久滞后

问题描述

我的 react-native 应用程序的 TextInput 使我的手机键盘即使在我关闭应用程序时也很迟钝。它正常工作,直到我尝试快速键入,它导致我的键盘缓慢和滞后。更糟糕的是,即使应用程序没有运行或在我清除应用程序的缓存后,我的键盘也会永久变慢。使其正常的唯一方法是重新启动手机。是bug吗?

<Portal>
        <Dialog visible={props.visible} ondismiss={hideDialog} style={{ backgroundColor: 'white',borderRadius: 10 }}>
            <Dialog.Title style={{ borderBottomWidth: 1,borderBottomColor: 'grey' }}>Report</Dialog.Title>
            <Dialog.Content>
                <TextInput
                    maxLength={500}
                    numberOfLines={10}
                    multiline={true}
                    autoFocus={true}
                    theme={ReportDialogTheme}
                    mode="outlined"
                    label="Reason"
                    placeholder="Reason for reporting"
                    value={inputReason}
                    onChangeText={text => setInputReason(text)}
                    selectionColor={THEME_SECONDARY}
                />
            </Dialog.Content>
            <Dialog.Actions style={{ backgroundColor: THEME_PRIMARY,borderBottomLefTradius: 10,borderBottomrighTradius: 10 }}>
                <Button onPress={hideDialog} mode='text' color="white">Cancel</Button>
                <Button onPress={report} mode='text' color="white">Submit</Button>
            </Dialog.Actions>
        </Dialog>
    </Portal>

TextInput 是从 react-native-paper 导入的

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)