Skip to content

Conversation

@LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Jan 28, 2021

Closes #1445

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@adobe-bot
Copy link

Build successful! 🎉

import {useTooltipTriggerState} from '@react-stately/tooltip';

const DEFAULT_OFFSET = 7; // Closest visual match to Spectrum's mocks
const DEFAULT_OFFSET = -1; // Closest visual match to Spectrum's mocks
Copy link
Member

Choose a reason for hiding this comment

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

why negative?

Copy link
Member Author

Choose a reason for hiding this comment

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

the design feedback wanted a distance of 4px between the button and the tooltip while we had a distance of 12px, hence the 7 - 8 = -1 for the default offset here. Didn't want to modify useOverlayPosition's math since that would affect other overlays so went for this default offset modification since we already had it defined

margin-left: var(--spectrum-tooltip-target-offset);
&.is-open {
@inherit: %spectrum-overlay--right--open;
/* @inherit: %spectrum-overlay--right--open; */
Copy link
Member

Choose a reason for hiding this comment

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

interesting, what was this? and why only comment it out?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah whoops, missed that, will fix

import {useTooltipTriggerState} from '@react-stately/tooltip';

const DEFAULT_OFFSET = 7; // Closest visual match to Spectrum's mocks
const DEFAULT_OFFSET = -1; // Closest visual match to Spectrum's mocks
Copy link
Member

Choose a reason for hiding this comment

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

should we change the comment now? I'm assuming this is being added to something

Copy link
Member

Choose a reason for hiding this comment

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

i forgot to submit my review, you answered the question for @dannify but could you make it a comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will do

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@dannify dannify merged commit fa31439 into main Feb 22, 2021
@dannify dannify deleted the tooltip_design_fixes branch February 22, 2021 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltip design fixes

5 participants