Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8af7a46

Browse files
Merge pull request #935 from ReactTooltip/fix/wrapper-behavior
fix: wrapper element changing after first render
2 parents 649378c + ca56886 commit 8af7a46

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

‎.npmignore‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ coverage/
2121
.travis.yml
2222
.editorconfig
2323

24-
// others
24+
// miscfolders
2525
.vscode/
2626
.husky/
2727
.github/
28+
29+
// misc files
30+
bundlesize.config.json
31+
32+
// bundler - rollup
33+
rollup.config.dev.js
34+
rollup.config.prod.js
35+
rollup.config.types.js

‎src/components/Tooltip/Tooltip.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Tooltip = ({
1919
events = ['hover'],
2020
positionStrategy = 'absolute',
2121
middlewares,
22-
wrapper: WrapperElement='div',
22+
wrapper: WrapperElement,
2323
children = null,
2424
delayShow = 0,
2525
delayHide = 0,
@@ -38,7 +38,7 @@ const Tooltip = ({
3838
setIsOpen,
3939
}: ITooltip) => {
4040
const tooltipRef = useRef<HTMLElement>(null)
41-
const tooltipArrowRef = useRef<HTMLDivElement>(null)
41+
const tooltipArrowRef = useRef<HTMLElement>(null)
4242
const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)
4343
const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)
4444
const [inlineStyles, setInlineStyles] = useState({})

‎src/components/Tooltip/TooltipTypes.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface ITooltip {
4343
id?: string
4444
variant?: VariantType
4545
anchorId?: string
46-
wrapper?: WrapperType
46+
wrapper: WrapperType
4747
children?: ChildrenType
4848
events?: EventsType[]
4949
positionStrategy?: PositionStrategy

‎src/components/TooltipController/TooltipController.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const TooltipController = ({
8585
setTooltipOffset(value === null ? offset : Number(value))
8686
},
8787
wrapper: (value) => {
88-
setTooltipWrapper((value as WrapperType) ?? 'div')
88+
setTooltipWrapper((value as WrapperType) ?? wrapper)
8989
},
9090
events: (value) => {
9191
const parsed = value?.split(' ') as EventsType[]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /