react-navigation / react-navigation/react-navigation

Drawer Navigation drawerItem onPress always give that gray background even with drawerActiveTintColor

Open
#10,645 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug platform:android repro provided
Dominant language
TypeScript
Stars
24.5k
Forks
5.1k
Avg merge
1d 5h
Merged PRs (30d)
18

Description

Current behavior
screenOptions={{
        headerShown: false,
        drawerLabelStyle: styles.drawerLStyle,
        drawerActiveBackgroundColor: 'rgba(120,94,168, .08)',
        drawerActiveTintColor: Colors.primary,
        swipeEdgeWidth: Dimensions.get('window').width / 2,
        drawerType: 'slide',
        drawerItemStyle: {
          borderRadius: 0,
          width: '100%',
          marginLeft: 0,
          paddingLeft: wp('2%'),
        },
      }}>

Capture d’écran 2022-06-20 175104

Expected behavior

will shouldn't background color be Color.primary instead of gray ?

Reproduction

https://github.com/ejjraifihamza/SobrusWorkspace

Platform
  • Android
  • iOS
  • Web
  • Windows
  • MacOS
Packages
  • @react-navigation/​bottom-tabs
  • @react-navigation/​drawer
  • @react-navigation/​material-bottom-tabs
  • @react-navigation/​material-top-tabs
  • @react-navigation/​stack
  • @react-navigation/​native-stack
Environment
package version
@react-navigation/native
@react-navigation/bottom-tabs
@react-navigation/drawer
@react-navigation/material-bottom-tabs
@react-navigation/material-top-tabs
@react-navigation/stack
@react-navigation/native-stack
react-native-safe-area-context
react-native-gesture-handler
react-native-reanimated
react-native

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked SobrusWorkspace reproduction and the @react-navigation/drawer screenOptions shown in the report, focusing on Android behavior around drawerItem onPress, drawerActiveTintColor, and drawerActiveBackgroundColor. Compare the rendered active and inactive states with the expected colors; done means reproducing the issue and identifying whether the behavior is incorrect or expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.