Skip to content

Child element does not fill parent height when using height: 100% #138

@Saikedo

Description

@Saikedo

It seems like the height attribute just gets ignored for the child of the toolTip if you use percentage height.

Let`s take a look at this example. Here the parent view has a height of 300 and I am setting the child component of the tooltip,
The view and the text inside, to havea height of 100%. What I expect here to happen is that the view that wraps the text will span the entire height of the parent view but it seems like that '100%' gets ignored and the height of the inner view is determined by the height of the text inside.

<View style={{ width: 250, height: 300, backgroundColor: '#ff0000' }}>
  <Tooltip
    isVisible={showTip}
    content={
      <View>
        <Text> I am a tooltip </Text>
      </View>
    }
    onClose={() => setTip(false)}
    placement="top"
  >
    <View style={{ backgroundColor: 'yellow', width: '100%', height: '100%', flex: 1,}}>
      <Text>Child component</Text>
    </View>
  </Tooltip>
</View>

I tried everything that came to mind, playing with flex, flexGrow, and a bunch of other things but nothing worked. Basically, as soon as I use a numeric value for height it`s all good but this does not work with percentages?

Any ideas on how I can address this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions