Skip to content

Input style not working in feedback widget on Android #5012

@OoDeLally

Description

@OoDeLally

What React Native libraries do you use?

Expo (mobile & Web)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.18.1

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇ 
System:
  OS: Linux 6.14 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
  CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
  Memory: 21.62 GB / 31.11 GB
  Shell:
    version: "5.9"
    path: /usr/bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: ~/.nvm/versions/node/v22.14.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v22.14.0/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v22.14.0/bin/npm
  Watchman:
    version: 4.9.0
    path: /usr/bin/watchman
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java: Not Found
  Ruby:
    version: 3.2.3
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.1.0
    wanted: latest
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.5
    wanted: 0.79.5
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found





Sentry.init()

const mobileReplayIntegration = Sentry.mobileReplayIntegration({
  maskAllText: false,
  maskAllImages: false,
  maskAllVectors: false,
});

const defaultWidgetStyle = defaultStyles({
  // Dummy values, I just need default styles to override the background color
  foreground: Colors.light.text,
  background: Colors.light.background,
});

const feedbackIntegration = Sentry.feedbackIntegration({
  styles: {
    submitButton: {
      ...defaultWidgetStyle.submitButton,
      backgroundColor: Colors.light.tint, // This works
    },
    input: {
      ...defaultWidgetStyle.input,
      color: 'red', // This is ignored
    },
  },
  colorScheme: 'system',
  themeLight: {
    foreground: Colors.light.text,
    background: Colors.light.background,
  },
  themeDark: {
    foreground: Colors.dark.text,
    background: Colors.dark.background,
  },
  showBranding: false,
  nameLabel: 'Name (optional)',
  emailLabel: 'Email (if we need further details)',
  namePlaceholder: 'How shall we call you?',
  messagePlaceholder:
    'What is the issue? Please describe it in detail, since it is the only info we get from you 🙏',
});

export const initSentry = () => {
  Sentry.init({
    dsn: 'https://foobar.ingest.de.sentry.io/baz',

    // Adds more context data to events (IP address, cookies, user, etc.)
    // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/
    sendDefaultPii: true,

    // Configure Session Replay
    replaysSessionSampleRate: 1,
    replaysOnErrorSampleRate: 1,
    integrations: [mobileReplayIntegration, feedbackIntegration],
    // uncomment the line below to enable Spotlight (https://spotlightjs.com)
    // spotlight: __DEV__,
  });
};

Steps to Reproduce

  1. Build any project with this config
  2. Run on android Expo

Expected Result

The inputs' placeholders in the feedback modal should be red

Actual Result

The inputs' placeholders in the feedback modal is black.

This works correctly on web (text is red). Not sure about iOS, i do not have any device to test.

it seems like there is a conflict of usage between the styles field and the new theme mechanism.
Unfortunately, FeedbackWidgetTheme does not cover all elements of the widget, so we are forced to hack it using styles.

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions