Skip to content

Color wheel misbehaves when placed in flexbox View #48

@tkanarsky

Description

@tkanarsky

If I create a ColorWheel component as a child of a flexbox View component, like so:

<View style={{display: "flex", flexDirection: "column", justifyContent: "flex-start"}}>
   <Text>Alpha</Text>
   <Text>Beta</Text>
   <Text>Gamma</Text>
    <ColorWheel
      initialColor="#ee0000"
      onColorChange={color => console.log({color})}
      onColorChangeComplete={color => onChange(color)}
      style={{width: Dimensions.get('window').width}}
      thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
    />
  </View>

the color wheel's height and width are set to zero -- only the thumb slider remains visible:
Screenshot_20200615-230417

By changing line 224 of ColorWheel.js from flex: 1, to display: flex,, the color wheel is properly sized and positioned in the flexbox:
Screenshot_20200615-230442

Let me know if this change fixes any issues or if I'm using the component wrong. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions