Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native:在小米10pro miui12.0.2 安卓10 设备上运行的时候,Text 组件在Button组件里面文字末尾丢失文字,例如:next 只显示 nex #11078

Open
awm-liang opened this issue Jan 11, 2022 · 6 comments
Assignees
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@awm-liang
Copy link

相关平台

React Native

使用框架: React

复现步骤

render () {
    return (
      <View className='index'>
        <Text>Hello world!</Text>  // 正常显示
        <Button><Text style={{flex: 1, flexDirection: 'column'}}>s create account</Text></Button> // 丢失单词 account
        <Text>create account</Text>  // 正常显示
        <Button><Text style={{flex: 1,  width: '100%', flexDirection: 'column'}}>copy</Text></Button> // 丢失单词 y
        <Button><Text style={{width: 0}}>0s copy</Text></Button> // 丢失单词 copy
        <Text>next</Text>  // 正常显示
        <Button><Text>reload</Text></Button> // 丢失字母 d
        <Text>replace</Text>  // 正常显示
        <Button><Text>s feel<Text style={{width: 10}}></Text></Text></Button> // 丢失字母 l
        <Text>luna reaplace</Text>  // 正常显示
      </View>
    )
  }

在小米10pro miui12.0.2 安卓10 设备上运行代码

期望结果

在小米10pro miui12.0.2 安卓10 设备上Button组件包裹的Text组件文字显示正常

实际结果

在小米10pro miui12.0.2 安卓10 设备上Button组件包裹的Text组件丢失文字

环境信息

👽 Taro v3.3.15


  Taro CLI 3.3.15 environment info:
    System:
      OS: macOS 12.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.13.0 - /usr/local/bin/node
      Yarn: 1.22.17 - /usr/local/bin/yarn
      npm: 8.1.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.3.15 => 3.3.15 
      @tarojs/components: 3.3.15 => 3.3.15 
      @tarojs/mini-runner: 3.3.15 => 3.3.15 
      @tarojs/react: 3.3.15 => 3.3.15 
      @tarojs/runtime: 3.3.15 => 3.3.15 
      @tarojs/taro: 3.3.15 => 3.3.15 
      @tarojs/webpack-runner: 3.3.15 => 3.3.15 
      babel-preset-taro: 3.3.15 => 3.3.15 
      eslint-config-taro: 3.3.15 => 3.3.15 
      react: ^17.0.2 => 17.0.2 
      react-native: ^0.66.0 => 0.66.3
@taro-bot2 taro-bot2 bot added F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x labels Jan 11, 2022
@awm-liang awm-liang changed the title 在小米10pro miui12.0.2 安卓10 设备上运行的时候,Text 组件在Button组件里面文字末尾丢失文字,例如:next 只显示 nex React Native:在小米10pro miui12.0.2 安卓10 设备上运行的时候,Text 组件在Button组件里面文字末尾丢失文字,例如:next 只显示 nex Jan 11, 2022
@zhiqingchen
Copy link
Member

使用的是什么字体

@zhiqingchen
Copy link
Member

尝试设置一下 fontFamily

style: { fontFamily: '' }

@zhiqingchen
Copy link
Member

另一方案,尝试给字符串末尾加空格

@zhiqingchen
Copy link
Member

MIUI 12.5.1 未发现丢失现象

@awm-liang
Copy link
Author

字体是默认的

@zhiqingchen
Copy link
Member

上面的两种方法,尝试了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants