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

Inconsistent separator lines #46968

Open
OtavioStasiak opened this issue Oct 10, 2024 · 3 comments
Open

Inconsistent separator lines #46968

OtavioStasiak opened this issue Oct 10, 2024 · 3 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Author Feedback Newer Patch Available

Comments

@OtavioStasiak
Copy link

Description

The thickness of the separator lines in FlatList is inconsistent on android. Here's another issue related to the separator: GitHub Issue.

Captura de Tela 2024-10-10 às 20 08 25

Steps to reproduce

Add a separator to a FlatList with hairlineWidth or 1.

React Native Version

0.73.6

Affected Platforms

Runtime - Android

Output of npx react-native info

Expo 51 from snack.

Stacktrace or Logs

import React from 'react';
import {
  SafeAreaView,
  View,
  FlatList,
  StyleSheet,
  Text,
  StatusBar,
} from 'react-native';

const DATA = [...Array(100).keys()]

const Separator = () => <View style={{ height: StyleSheet.hairlineWidth, backgroundColor: '#000' }} />

const Item = ({title}) => (
  <View style={styles.item}>
    <Text style={styles.title}>{title}</Text>
  </View>
);

const App = () => {
  return (
    <SafeAreaView style={styles.container}>
      <FlatList
        data={DATA}
        renderItem={({item}) => <Item title={item} />}
        ItemSeparatorComponent={Separator}
      />
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: StatusBar.currentHeight || 0,
  },
  item: {
    backgroundColor: 'white',
    padding: 12,
  },
  title: {
    fontSize: 20,
  },
});

export default App;

Reproducer

https://snack.expo.dev/@diegolmello/f6c27a

Screenshots and Videos

Captura de Tela 2024-10-10 às 20 08 25
@react-native-bot
Copy link
Collaborator

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.73.10. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Oct 11, 2024
@shubhamguptadream11
Copy link
Collaborator

@OtavioStasiak I tested this on multiple real android devices.
It seems that it is reproducible on emulators only.

Are you able to repro this on any real device?

Device used:

  • VIVO V2125
  • OPPO CPH2185
  • REALME RMX2081
  • REDMI k20 pro
  • REDMI 9A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Needs: Author Feedback Newer Patch Available
Projects
None yet
Development

No branches or pull requests

4 participants