feat: support closing modal via back button
This commit is contained in:
parent
53c8483a3f
commit
60fca48a72
10 changed files with 264 additions and 44 deletions
|
|
@ -12,6 +12,12 @@ export function isSafari() {
|
|||
return /Safari/.test(ua) && /Apple Computer/.test(vendor) && !/Chrome/.test(ua)
|
||||
}
|
||||
|
||||
export function isAndroid() {
|
||||
if (typeof window === 'undefined' || !window.navigator) return false
|
||||
const ua = window.navigator.userAgent
|
||||
return /android/i.test(ua)
|
||||
}
|
||||
|
||||
export function isInViewport(el: HTMLElement) {
|
||||
const rect = el.getBoundingClientRect()
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue