mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-13 20:04:35 +03:00
Merge pull request #3802 from tylershuster/hoon-scroll
chat: fixed embedded scroll item disability
This commit is contained in:
commit
82ad2a6a82
@ -244,7 +244,17 @@ export default class VirtualScroller extends PureComponent<VirtualScrollerProps,
|
||||
element.addEventListener('wheel', (event) => {
|
||||
event.preventDefault();
|
||||
const normalized = normalizeWheel(event);
|
||||
element.scrollBy(0, normalized.pixelY * -1);
|
||||
if (
|
||||
(event.target.scrollHeight > event.target.clientHeight && event.target.clientHeight > 0) // If we're scrolling something with a scrollbar
|
||||
&& (
|
||||
(event.target.scrollTop > 0 && event.deltaY < 0) // Either we're not at the top and scrolling up
|
||||
|| (event.target.scrollTop < event.target.scrollHeight - event.target.clientHeight && event.deltaY > 0) // Or we're not at the bottom and scrolling down
|
||||
)
|
||||
) {
|
||||
event.target.scrollBy(0, normalized.pixelY);
|
||||
} else {
|
||||
element.scrollBy(0, normalized.pixelY * -1);
|
||||
}
|
||||
return false;
|
||||
}, { passive: false });
|
||||
window.addEventListener('keydown', this.invertedKeyHandler, { passive: false });
|
||||
|
Loading…
Reference in New Issue
Block a user