Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create Tooltip component #3441

Merged
merged 8 commits into from
Nov 14, 2022
Merged

feat: create Tooltip component #3441

merged 8 commits into from
Nov 14, 2022

Conversation

brunohkbx
Copy link
Collaborator

Summary

This PR implements the Tooltip component described here in MD2 docs.

Tooltips display informative text when users hover over, focus on, or tap an element.
When activated, tooltips display a text label identifying an element, such as a description of its function.

This covers only the minimum functionality to make it usable. Desktop support and animated Transitions described in MD docs are not implemented. Future work can be done and is welcome to support all use cases.

Test plan

Behavior

A tooltip is displayed upon tapping and holding a screen element or component (on mobile) or hovering over it (desktop). Continuously display the tooltip as long as the user long-presses or hovers over the element.

Timing

Display the tooltip for 1.5 seconds. If the user takes another action before that time ends, the tooltip will disappear.

Show case

Placement

The tooltip can overflow to the left / right or bottom depending on where the wrapped element is placed on the screen.

The purpose of the following test cases is to show that the tooltip text does not goes offscreen.

  1. Overflow To Left
    Test 1

  2. Overflow To Right
    Test 2

  3. Overflow To Bottom
    Test 3

  4. Normal placement
    Test 4

@brunohkbx brunohkbx requested a review from lukewalczak October 27, 2022 05:03
@brunohkbx brunohkbx self-assigned this Oct 27, 2022
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/components/Appbar/AppbarAction.tsx Show resolved Hide resolved
src/components/Appbar/AppbarAction.tsx Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
@lukewalczak
Copy link
Member

Hello @brunohkbx, thanks for adding new component 🔥 I will answer your questions/comments in the upcoming days 🙌🏽

@callstack-bot
Copy link

callstack-bot commented Oct 29, 2022

Hey @brunohkbx, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@callstack callstack deleted a comment from github-actions bot Oct 29, 2022
@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

@callstack callstack deleted a comment from github-actions bot Oct 29, 2022
@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

example/src/Examples/IconButtonExample.tsx Outdated Show resolved Hide resolved
src/components/Tooltip/index.ts Outdated Show resolved Hide resolved
src/components/Tooltip/Tooltip.tsx Show resolved Hide resolved
@lukewalczak lukewalczak requested a review from jaworek October 31, 2022 09:28
@lukewalczak lukewalczak changed the title feat: create tooltip component feat: create Tooltip component Oct 31, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

The mobile version of example app from this branch is ready! You can see it here

.

Copy link
Member

@lukewalczak lukewalczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @brunohkbx 🚀

@lukewalczak lukewalczak merged commit bc2a1c4 into main Nov 14, 2022
@lukewalczak lukewalczak deleted the feat/tooltip branch November 14, 2022 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants