Skip to content

Commit

Permalink
fix: elementCanBeScrolled fails if node is not an HTMLElement
Browse files Browse the repository at this point in the history
  • Loading branch information
PottyZA committed Apr 30, 2024
1 parent 3c05dd6 commit baa56c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/handleScroll.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Axis } from './types';
import {Axis} from './types';

const alwaysContainsScroll = (node: HTMLElement): boolean =>
// textarea will always _contain_ scroll inside self. It only can be hidden
node.tagName === 'TEXTAREA';

const elementCanBeScrolled = (node: HTMLElement, overflow: 'overflowX' | 'overflowY'): boolean => {
if (!(node instanceof HTMLElement)) return false;

const styles = window.getComputedStyle(node);

return (
Expand Down

0 comments on commit baa56c3

Please sign in to comment.