Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Remove initialHorizontal and initialVertical: Wikipedia is smarter ab…
Browse files Browse the repository at this point in the history
…out inline link triggers
  • Loading branch information
atomiks committed Jan 12, 2019
1 parent 526720f commit 4aa32de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 1 addition & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ export interface Props {
distance?: number
flip?: boolean
flipBehavior?: 'flip' | Placement[]
followCursor?:
| boolean
| 'vertical'
| 'horizontal'
| 'initial'
| 'initialVertical'
| 'initialHorizontal'
followCursor?: boolean | 'vertical' | 'horizontal' | 'initial'
hideOnClick?: boolean | 'toggle'
inertia?: boolean
interactive?: boolean
Expand Down
9 changes: 3 additions & 6 deletions src/js/createTippy.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,8 @@ export default function createTippy(reference, collectionProps) {

const rect = tip.reference.getBoundingClientRect()
const { followCursor } = tip.props
const isHorizontal = includes(
['horizontal', 'initialHorizontal'],
followCursor,
)
const isVertical = includes(['vertical', 'initialVertical'], followCursor)
const isHorizontal = followCursor === 'horizontal'
const isVertical = followCursor === 'vertical'

tip.popperInstance.reference = {
getBoundingClientRect: () => ({
Expand All @@ -259,7 +256,7 @@ export default function createTippy(reference, collectionProps) {

tip.popperInstance.scheduleUpdate()

if (includes(String(followCursor), 'initial') && tip.state.isVisible) {
if (followCursor === 'initial' && tip.state.isVisible) {
removeFollowCursorListener()
}
}
Expand Down

0 comments on commit 4aa32de

Please sign in to comment.