diff --git a/ui/bits/src/bits.challengePage.ts b/ui/bits/src/bits.challengePage.ts index f2231830820d..8bc5d30c2ae9 100644 --- a/ui/bits/src/bits.challengePage.ts +++ b/ui/bits/src/bits.challengePage.ts @@ -69,17 +69,21 @@ export function initModule(opts: ChallengeOpts): void { if (isTouchDevice() && typeof navigator.share === 'function') { const inviteUrl = document.querySelector('.invite__url'); if (!inviteUrl) return; + inviteUrl.classList.add('none'); + const instructions = document.querySelector(`.mobile-instructions`)!; instructions.classList.remove('none'); - inviteUrl.classList.add('none'); - instructions.closest('.details-wrapper')!.onclick = () => + if (isIOS()) instructions.classList.add('is-ios'); + + const details = instructions.closest('.details-wrapper')!; + details.role = 'button'; + details.onclick = () => navigator .share({ title: `Fancy a game of chess?`, url: inviteUrl.querySelector('input')?.value, }) .catch(() => {}); - if (isIOS()) instructions.classList.add('is-ios'); } }