question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

event handling delayed

See original GitHub issue

When scrolling with WindowScroller, I receive this error in the browser console:

Handling of ‘mousewheel’ input event was delayed for 671 ms due to main thread being busy. Consider marking event handler as ‘passive’ to make the page more responive.

This causes the scrolling behavior to be extremely choppy and virtually unusable. Your demo content makes this package look awesome and we are attempting to convert our app from react-infinite to virtualized but are so far not having much luck.

I found this thread on the topic - and it appears that React has an open issue in regards to passive event handlers : http://stackoverflow.com/questions/39152877/consider-marking-event-handler-as-passive-to-make-the-page-more-responive

In addition to the scroll lag, it seems that the initial rendering of the component takes 1-2 seconds, and each time i resize the window it takes a couple of seconds for the UI to catch up. I dont see any of this behavior in your demos.

I will paste my code below, but I was wondering if this was a known issue, and if i’m doing anything wrong - I’ve been reading the documentation for days and doing my best to grock how this is supposed to work.

_renderDays() {
        var count = 0;
        return this.data.shifts.map((shiftGroup) => {
            count++;
            return (
              <Paper
                key={count}
                zDepth={2}
              >
                <Subheader>{shiftGroup.day}</Subheader>
                <mList> //materialUI List component
                  {this._renderShifts(shiftGroup.shifts)}
                </mList>
              </Paper>
            );
        });
    },
render() {
        let height = this.props.height || 400
        return (
          <WindowScroller>
            {({height, isScrolling, scrollTop})=>(
              <List
              height={height}
              rowCount={this.data.shifts.length}
              rowHeight={200}
              rowRenderer={this._renderDays}
              scrollTop={scrollTop}
              width={this.state.window.width}/>
            )}
          </WindowScroller>
        )
    },

Let me know if you need anything else to look at - these seemed to be the relevant parts of the component.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tonymckendrycommented, Oct 27, 2016

@bvaughn to the rescue again - turns out I needed to install the react-addons-shallow-compare package - problem solved

1reaction
bvaughncommented, Oct 25, 2016

@tonymckendry Yay great 😄 Glad to hear!

And you’re welcome, @7rulnik 😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Is there a way to delay an event handler (say for 1 sec) in ...
It means you can easily "cancel" the delayed event if you need to, by disabling the timer again, for example. It also does...
Read more >
Delayed Event Processing - Part 2 - DEV Community ‍ ‍
In my previous post I showed you how you can handle multiple events but only trigger downstream processes in batches.
Read more >
Delayed event - Glossary - Statecharts
A delayed event is the ability for the statechart to send an event after a certain period of time. Delayed events can be...
Read more >
How to delay a JavaScript event within an event listener · GitHub
Remove 'open" class with a delay. menuLinks[i].addEventListener('mouseout', function () {. var node = this; // Allows us to access 'this' within the timeout ......
Read more >
Delayed Events Example - Informatica Documentation
On the Profile > Delayed Processing tab, add a Delay Rule, using the Specific Event Rule option. Use EventType as the attribute name,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found