Skip to content

Commit 9ad91ad

Browse files
committed
fix(typescript): change action to optional
1 parent 2801113 commit 9ad91ad

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

src/action-tooltip.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface TooltipActionProps {
55
* The action to trigger the tooltip
66
* @default 'hover'
77
*/
8-
action: 'hover' | 'click' | 'prop' | string;
8+
action?: 'hover' | 'click' | 'prop' | string;
99

1010
/**
1111
* The alignment of the tooltip.

src/helpers.js

-6
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ export const computeTooltipPosition = (
8585
const elementPosition = computedStyle.position;
8686
const currentRect = currentElement.getBoundingClientRect();
8787

88-
// if (elementPosition === 'static') {
89-
// currentElement = currentElement.parentElement;
90-
// continue;
91-
// }
92-
93-
// console.log()
9488
if (elementPosition === 'fixed') {
9589
fixedOffsetTop +=
9690
currentRect.top + window.scrollY;

src/tooltip.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface TooltipProps {
55
* The action to trigger the tooltip
66
* @default 'hover'
77
*/
8-
action: 'hover' | 'click' | 'prop' | string;
8+
action?: 'hover' | 'click' | 'prop' | string;
99

1010
/**
1111
* The alignment of the tooltip.

0 commit comments

Comments
 (0)