Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
43b4252a
Unverified
Commit
43b4252a
authored
4 years ago
by
Hiws
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix tooltip hide method when already hidden (#31115)
Co-authored-by:
XhmikosR
<
xhmikosr@gmail.com
>
parent
a690a67c
1 merge request
!31948
Examples/Floating-labels: fix bad behavior with autofill
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/src/tooltip.js
+4
-0
js/src/tooltip.js
js/tests/unit/tooltip.spec.js
+14
-0
js/tests/unit/tooltip.spec.js
with
18 additions
and
0 deletions
+18
-0
js/src/tooltip.js
+
4
-
0
View file @
43b4252a
...
...
@@ -331,6 +331,10 @@ class Tooltip {
}
hide
()
{
if
(
!
this
.
_popper
)
{
return
}
const
tip
=
this
.
getTipElement
()
const
complete
=
()
=>
{
if
(
this
.
_hoverState
!==
HOVER_STATE_SHOW
&&
tip
.
parentNode
)
{
...
...
This diff is collapsed.
Click to expand it.
js/tests/unit/tooltip.spec.js
+
14
-
0
View file @
43b4252a
...
...
@@ -717,6 +717,20 @@ describe('Tooltip', () => {
tooltip
.
show
()
})
it
(
'
should not throw error running hide if popper hasn
\'
t been shown
'
,
()
=>
{
fixtureEl
.
innerHTML
=
'
<div></div>
'
const
div
=
fixtureEl
.
querySelector
(
'
div
'
)
const
tooltip
=
new
Tooltip
(
div
)
try
{
tooltip
.
hide
()
expect
().
nothing
()
}
catch
{
throw
new
Error
(
'
should not throw error
'
)
}
})
})
describe
(
'
update
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets