c3js / c3js/c3

[Violation] 'focus' handler took XXX ms

Open
#2,742 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

* **C3 version**: v0.7.12
* **D3 version**: v5.15
* **Browser**: Chrome 79.0.3945.130 (Build officiel) (64 bits)
* **OS**: Windows 10 (64 bits)

Hi,
Thanks for this amazing lib !

The console log of Chrome is cluttered with verbose message of this type:
**[Violation] 'focus' handler took 519ms c3.js:2311**
Which makes the navigation on the page very bad. The clicks responsiveness is totally bad at some point.

Here's a little JSFiddle 👍
https://jsfiddle.net/Viseth7/ad19b7s6/8/

1. open the console.log
2. click on the icon at the top left corner
3. move the subchart aera back and forth and navigate to another tab of your browser

=> message log verbose appear and the navigation experience goes bad.

All messages point to the same line of code " this.windowFocusHandler = function ()" :

`
ChartInternal.prototype.bindWindowFocus = function () {
var _this = this;

if (this.windowFocusHandler) {
// The handler is already set
return;
}

this.windowFocusHandler = function () {
_this.redraw();
};

//window.addEventListener('focus', this.windowFocusHandler)
//custom
window.addEventListener('focus', this.windowFocusHandler, { capture: true, passive: true });
};
`

Please below is the console log screeshot.

![image](https://user-images.githubusercontent.com/1708388/73080842-c94dfe80-3ec6-11ea-84f7-84265f3fb073.png)

I don't know whether this has to do with uikit-3.2.7 that I used in this project.

Does anyone else experience the same ?
Any hints and idea ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.