mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
Add preventScroll check
This commit is contained in:
15
src/utilities/support.ts
Normal file
15
src/utilities/support.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Determines if the browser supports focus({ preventScroll })
|
||||
//
|
||||
export function isPreventScrollSupported() {
|
||||
let supported = false;
|
||||
|
||||
document.createElement('div').focus({
|
||||
get preventScroll() {
|
||||
supported = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return supported;
|
||||
}
|
||||
Reference in New Issue
Block a user