Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特定のバージョン以上のipadでもモーダルがクリックで閉じられるように #4117

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/lib/dom/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ export const isSafari = () => {
return ua.includes('safari') && !ua.includes('chrome') && !ua.includes('edge')
}

/** 特定の条件のiPadだとuaに'ipad'の文字列を含まない
* https://qiita.com/ShingoFukuyama/items/ef573a8e3e23ef12542e
* 'macinstosh'だとmacOSも含まれてしまうため、含まないように`'ontouchend' in document`の条件も追加
* https://jsnotice.com/posts/2019-09-08/index.html
*/
export const isIOS = () => {
return ua.includes('iphone') || ua.includes('ipod') || ua.includes('ipad')
return (
ua.includes('iphone') ||
ua.includes('ipod') ||
ua.includes('ipad') ||
(ua.includes('macintosh') && 'ontouchend' in document)
)
}

export const isFirefox = () => {
Expand Down