Skip to content

Commit

Permalink
Fix infinite loop (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Palmer <felixpalmer@gmail.com>
  • Loading branch information
Pessimistress and felixpalmer authored Dec 5, 2024
1 parent d5a1b60 commit cb86a8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/vite.config.local.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {defineConfig} from 'vite';
import {getOcularConfig} from 'ocular-dev-tools';
import {getOcularConfig} from '@vis.gl/dev-tools';
import {join} from 'path';
import {fileURLToPath} from 'url';

Expand Down
8 changes: 4 additions & 4 deletions src/hammerjs/utils/has-parent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* find if a node is in the given parent
*/
export default function hasParent(node: HTMLElement, parent: HTMLElement): boolean {
let ancester: Node | null = node;
while (ancester) {
if (ancester === parent) {
let ancestor: Node | null = node;
while (ancestor) {
if (ancestor === parent) {
return true;
}
ancester = node.parentNode;
ancestor = ancestor.parentNode;
}
return false;
}

0 comments on commit cb86a8c

Please sign in to comment.