Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 756007d

Browse files
author
Sean Dawson
committed
fix: fix issue with tooltip flickering
The mouse over event bubbles up to parent elements, so even though the mouse out event fired to close a previous tooltip, the mouse over event would bubble up and reactivate the tooltip. In the best case this made duplicate tooltips, in the worst case it created visual glitches. fix #20
1 parent 86bf94f commit 756007d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

public/example_xml/nice-example-diff.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ payload distinctBy $.pies]]></dw:set-payload>
5757
</scatter-gather>
5858
<http:request config-ref="" path="" method="" doc:name="Start Internal Noodle Engine"/>
5959
</sub-flow>
60-
<munit:test description="Bork Bork" name="some-test">
60+
<munit:test description="Bork Bork" name="some-test-2">
6161
<mock:when doc:name="xxxx" messageProcessor=".*:.*">
6262
<mock:with-attributes>
6363
<mock:with-attribute name="name" whereValue="#[matchContains('zzzyyy')]"/>

src/main/mule_preview/client/components.cljs

+8-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@
137137
(fn []
138138
[:div {:ref #(reset! anchor-el %)}
139139
[:div {:class ["component-container" css-class]
140-
:on-mouse-over (m/handler-fn (reset! showing-atom should-show-tooltip))
140+
:on-mouse-over (m/handler-fn
141+
(when should-show-tooltip
142+
(reset! showing-atom should-show-tooltip)
143+
(.stopPropagation event)))
141144
:on-mouse-out (m/handler-fn (reset! showing-atom false))}
142145
(when diff-icon-url (image diff-icon-url "diff-icon" content-root))
143146
[:div
@@ -162,7 +165,10 @@
162165
(fn []
163166
[:div {:ref #(reset! anchor-el %)}
164167
[:div {:class ["container" generated-css-class css-class]
165-
:on-mouse-over (m/handler-fn (reset! showing-atom should-show-tooltip))
168+
:on-mouse-over (m/handler-fn
169+
(when should-show-tooltip
170+
(reset! showing-atom should-show-tooltip)
171+
(.stopPropagation event)))
166172
:on-mouse-out (m/handler-fn (reset! showing-atom false))}
167173
[:div {:class "container-title"} description]
168174
[:div {:class "container-inner"}

0 commit comments

Comments
 (0)