tuax / tua-body-scroll-lock

🔐 Body scroll locking that just works with everything
https://tuax.github.io/tua-body-scroll-lock/
MIT License
418 stars 30 forks source link

fix: allow Nullable targetElement #34

Closed magic-akari closed 4 years ago

magic-akari commented 4 years ago

Summary

What kind of change does this PR introduce? (check at least one)

The PR fulfills these requirements:

You have tested in the following platforms:

Providing a reproduction demo will be better(you can pick a platform below and fork the demo):

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Why Nullable:

document.querySelector() or document.getElementById() return Nullable result.

Writing lock(document.querySelector('.target')) is more concise than writing lock(document.querySelector('.target') || undefined)

BuptStEve commented 4 years ago

LGTM

BuptStEve commented 4 years ago

@all-contributors add @magic-akari for bug

allcontributors[bot] commented 4 years ago

@BuptStEve

I've put up a pull request to add @magic-akari! :tada: