Skip to content

Commit f6faa37

Browse files
hustlelikeabossevinma
authored andcommitted
fix: filter out nullish target elements before unlock
1 parent 52cd177 commit f6faa37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/methods.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function unlock (targetElement?: Nullable<HTMLElement>, options?: BSLOpti
6868
toArray(targetElement).forEach((element) => {
6969
const index = lockState.lockedElements.indexOf(element)
7070

71-
if (index !== -1) {
71+
if (element && index !== -1) {
7272
element.ontouchmove = null
7373
element.ontouchstart = null
7474
lockState.lockedElements.splice(index, 1)

0 commit comments

Comments
 (0)