Skip to content

Commit

Permalink
test test
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Aug 6, 2024
1 parent 2ab2b3c commit 8416113
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react/src/TooltipV2/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ const interactiveElements = [
]

const isInteractive = (element: HTMLElement) => {
console.log('my element', element)

Check failure on line 182 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
return (
interactiveElements.some(selector => element.matches(selector)) ||
(element.hasAttribute('role') && element.getAttribute('role') === 'button')
Expand Down Expand Up @@ -249,10 +250,11 @@ export const Tooltip = React.forwardRef(
const hasInteractiveChild = Array.from(triggerChildren).some(child => {
return child instanceof HTMLElement && isInteractive(child)
})
invariant(
isTriggerInteractive || hasInteractiveChild,
'The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead.',
)
console.log('test logging', triggerRef.current, isTriggerInteractive, hasInteractiveChild)

Check failure on line 253 in packages/react/src/TooltipV2/Tooltip.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
// invariant(
// isTriggerInteractive || hasInteractiveChild,
// 'The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or equivalent interactive element instead.',
// )
// If the tooltip is used for labelling the interactive element, the trigger element or any of its children should not have aria-label
if (type === 'label') {
const hasAriaLabel = triggerRef.current.hasAttribute('aria-label')
Expand Down

0 comments on commit 8416113

Please sign in to comment.