Skip to content

Content cut off in tooltip #152

Open
@dansimau

Description

@dansimau

I am trying to build a simple tooltip:

const styles = StyleSheet.create({
  tooltipTitle: {
    marginBottom: 10,
    fontWeight: "bold",
  },
  tooltipText: {
    color: "#444",
    fontSize: 16,
    lineHeight: 20,
  },
});

export const makeTooltipContent = (opts: {title?: string; text: string}) => (
  <View style={{padding: 8}}>
    {opts.title !== undefined ? (
      <Text style={[styles.tooltipText, styles.tooltipTitle]}>
        {opts.title}
      </Text>
    ) : null}

    <Text style={styles.tooltipText}>{opts.text}</Text>
  </View>
);

Snippet from my component:

                <Tooltip
                  isVisible={true}
                  content={makeTooltipContent({
                    title: "Leave a personal note",
                    text: "Help others know why a place is great. ✨",
                  })}
                  placement="left">
                  <FilledButton style={Buttons.Text} title="Add tip" />
                </Tooltip>

The result is:

Screenshot 2022-04-25 at 17 01 09

Am I missing something?

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