-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling timeout hover performance issue #697
Comments
This is out of my control, as noted in those other issues you linked to. I'm not sure what more I can say that I've already said in those issues. If you don't want pointer events to be disabled while scrolling, you can override that behavior as noticed in the replies I linked to. I'm closing this because it's not actionable. We can talk more here or on Slack if you have follow up questions or concerns though. |
Setting pointer-events to It is good that there is an issue though so people like me that search for that problem will find this. |
If you read my replies to the issues you mentioned above, including the one I linked to, you'll see this:
|
I did in fact read them, but as I said, the I understand that this is maybe not actionable but it still needs to be documented or reported as this is more or less might be a deal-breaker for some people that need the hover functionality. |
If overriding the
Your tone sounds a bit aggressive to me. Perhaps I'm interpreting it incorrectly. But please remember that I created this library and support it (by responding to issues like this) in my spare time, for free. Here's a Plnkr that shows the workaround working: https://plnkr.co/edit/rzOpcO?p=preview If it doesn't work for your application, you'll need to at least provide a repro case where I can see it not working before I'll look into it any further. |
Sorry, I definitely did not intend to sound aggressive, thank you very much for maintaining this awesome library! Once i have time i will look into it! |
I suppose you've tried this already:
This as an effect on chrome on my current UI |
Surprisingly perf wise I can't tell the difference. |
My schedule is very tight right now but at some point in time there will be enough time to fix this issue in the app. Once I find a solution I will post it here.
yeah, the only effect is, that the cursor is a pointer all the time but the hover event does not get triggered... |
@bvaughn I answer here as your answer on the other linked issue belongs here I think. No, the plnkr did not work because it is not the mouse hovering that does not work. Setting the pointer events will only cause the css selector
I think i will try this and see if it accomplishes something but this is indeed a terrible hack. |
Thanks for elaborating @Maxincredible52! I didn't realize it was a callback issue. (I see now that you mentioned this before but I somehow overlooked it.) Also, I responded to your comment on the other issue via email so I didn't realize it was a continuation of this thread. 😄 Anyway, my apologies!
React is actually already doing this for events it manages. It listens for things at the document level. Still I guess it's worth a shot to see if you get different results using a "vanilla" document event listener. |
I'm having this same issue on my project that I'm using the Like some people already said in this kind of issue, this is happening because the browser is delaying the There are plans to someone work on it ? I tested an workarround on my project using // I just wrote it as draft, needs to be tested and refactored
_debounceScrollEnded() {
const { scrollingResetTimeInterval } = this.props
if (this._disablePointerEventsTimeoutId) {
cancelAnimationFrame(this._disablePointerEventsTimeoutId)
this._scrollDebounceStart = Date.now();
}
const delay = function() {
if (Date.now() - this._scrollDebounceStart >= scrollingResetTimeInterval) {
this._debounceScrollEndedCallback();
this._scrollDebounceStart = Date.now();
} else {
this._disablePointerEventsTimeoutId = requestAnimationFrame(delay);
}
}
delay.bind(this);
this._disablePointerEventsTimeoutId = requestAnimationFrame(delay);
this._scrollDebounceStart = Date.now();
} |
@guilhermefloriani: I'm not planning on tackling it, no. If you'd like to submit a PR, I'll review it though. If it seems like an improvement, I'll merge it in. |
Ok @bvaughn. I'm little busy these days, but I'll try to work on it this week. |
For everybody that stumbles upon this issue, possible solution here #722 |
In my particular case I use the Table element and I have to set the hovered row index to the component state in order to activate special functionality in my sub-components that are rendered inside of a table row.
The hovered row index is set by using the provided
onRowMouseOver
prop of the Table component.When scrolling sometimes the hover event takes several seconds to kick in (up to 2 to 3 seconds(!)) and prevents the table from being able to be hovered during that time span which is horrible for user experience as it can be seen in the following gif (note that I did not slow down, this is realtime)
The issue only occurs in chrome as far as i could test it, other browsers like Edge or Firefox do not have that issue. Another strange behavior of the problem is, that it seems to resolve itself. After a certain amount of time playing around with the table by scrolling and hovering over some rows the hover events behave as they should. When the page is reloaded the issue comes back though.
After research I came to the conclusion that this issue might relate to the issues #564 #322 and maybe #518 but I thought I have to open a new issue as there is no issue that exactly covers my use case.
The text was updated successfully, but these errors were encountered: