srivastavaanurag79 / react-native-paper-select

Dropdown using React Native Paper TextInput, Checkbox and Dialog
https://anurag-srivastava.gitbook.io/react-native-paper-select/
MIT License
48 stars 15 forks source link

Use Paper theme by default #49

Closed WillSmithTE closed 2 months ago

WillSmithTE commented 7 months ago

I thought this package would use PaperProvider theme by default, and while technically it does, it also overrides styles meaning the theme is ignored.

E.g. I useMD3DarkTheme for dark mode, but the styling for the TextInput is overridden because it uses its own styles.

textInput: {
    backgroundColor: '#fff',
    color: '#000',
  },

here

Is this intentional? Would you accept a PR to change it?

Same for the dialog background color

WillSmithTE commented 7 months ago

Similarly, if we could import Text from react-native-paper here we'd keep the theme

GunnarAK commented 5 months ago

This is also the case for the dialog portion. The backgroundColor is set to white and is not inheriting the app theme.

https://github.com/srivastavaanurag79/react-native-paper-select/blob/master/src/module/paperSelect.tsx#L375

const styles = StyleSheet.create({
  container: {
    width: '100%',
    marginBottom: 10,
  },
  dialog: {
    backgroundColor: 'white',      <-----
    borderRadius: 5,
  },
  ...

Temp fix is setting the dialogStyle={{backgroundColor: colorScheme === "dark" ? "YOUR_DARK_COLOR" : "YOUR_LIGHT_COLOR"}} prop on your <PaperSelect /> component.

srivastavaanurag79 commented 5 months ago

will fix it in next update

srivastavaanurag79 commented 2 months ago

@himrocks33 Please fix this in your merge request also