You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/23 21:53:47 UTC

[GitHub] [incubator-echarts] chfw commented on a change in pull request #12781: fix(tooltip): tooltip should be hidden when mouse leaves tooltip content even if it is enterable, fix #12778.

chfw commented on a change in pull request #12781:
URL: https://github.com/apache/incubator-echarts/pull/12781#discussion_r444530377



##########
File path: src/component/tooltip/TooltipContent.js
##########
@@ -218,12 +218,15 @@ function TooltipContent(container, api, opt) {
         }
     };
     el.onmouseleave = function () {
+        // fix #12778
+        // we should set `_inContent` before `hideLater`
+        self._inContent = false;
+
         if (self._enterable) {
             if (self._show) {
                 self.hideLater(self._hideDelay);

Review comment:
       I felt this hideLater function has a flaw. A function shall not change its behaviour when un-related variable changes.
   
   So basically, hideLater is a trap for next developer. and I do not want to be the next one.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org