Skip to content

Commit 429be65

Browse files
committed
chore: adds scale prop
1 parent 49e3352 commit 429be65

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/magic-sdk/src/iframe-controller.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ import { MagicIncomingWindowMessage, MagicOutgoingWindowMessage } from '@magic-s
88
const overlayStyles: Partial<CSSStyleDeclaration> = {
99
display: 'block',
1010
visibility: 'hidden',
11-
pointerEvents: 'none',
1211
position: 'fixed',
1312
top: '0',
1413
right: '0',
1514
width: '100%',
1615
height: '100%',
1716
borderRadius: '0',
1817
border: 'none',
19-
zIndex: '-1',
2018
// necessary for iOS Safari
2119
opacity: '0',
20+
// necessary for iOS 17 and earlier
21+
zIndex: '-1',
22+
transform: 'scale(0)',
2223
};
2324

2425
/**
@@ -129,8 +130,8 @@ export class IframeController extends ViewController {
129130
protected async showOverlay() {
130131
const iframe = await this.iframe;
131132
iframe.style.visibility = 'visible';
132-
iframe.style.pointerEvents = 'auto';
133133
iframe.style.zIndex = '2147483647';
134+
iframe.style.transform = 'scale(1)';
134135
iframe.style.opacity = '1';
135136
this.activeElement = document.activeElement;
136137
iframe.focus();
@@ -139,8 +140,8 @@ export class IframeController extends ViewController {
139140
protected async hideOverlay() {
140141
const iframe = await this.iframe;
141142
iframe.style.visibility = 'hidden';
142-
iframe.style.pointerEvents = 'none';
143143
iframe.style.zIndex = '-1';
144+
iframe.style.transform = 'scale(0)';
144145
iframe.style.opacity = '0';
145146
if (this.activeElement?.focus) this.activeElement.focus();
146147
this.activeElement = null;

packages/magic-sdk/test/spec/iframe-controller/hideOverlay.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test('Change visibility style to `hidden` and opacity to 0', async () => {
2222
await (overlay as any).hideOverlay();
2323

2424
expect((overlay as any).iframe).toEqual({
25-
style: { visibility: 'hidden', opacity: '0', pointerEvents: 'none', zIndex: '-1' },
25+
style: { visibility: 'hidden', opacity: '0', zIndex: '-1', transform: 'scale(0)' },
2626
});
2727
});
2828

0 commit comments

Comments
 (0)