Skip to content

Commit

Permalink
fix(typescript): change action to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
dysfunc committed Apr 28, 2024
1 parent 2801113 commit 9ad91ad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/action-tooltip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface TooltipActionProps {
* The action to trigger the tooltip
* @default 'hover'
*/
action: 'hover' | 'click' | 'prop' | string;
action?: 'hover' | 'click' | 'prop' | string;

/**
* The alignment of the tooltip.
Expand Down
6 changes: 0 additions & 6 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ export const computeTooltipPosition = (
const elementPosition = computedStyle.position;
const currentRect = currentElement.getBoundingClientRect();

// if (elementPosition === 'static') {
// currentElement = currentElement.parentElement;
// continue;
// }

// console.log()
if (elementPosition === 'fixed') {
fixedOffsetTop +=
currentRect.top + window.scrollY;
Expand Down
2 changes: 1 addition & 1 deletion src/tooltip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface TooltipProps {
* The action to trigger the tooltip
* @default 'hover'
*/
action: 'hover' | 'click' | 'prop' | string;
action?: 'hover' | 'click' | 'prop' | string;

/**
* The alignment of the tooltip.
Expand Down

0 comments on commit 9ad91ad

Please sign in to comment.