-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(browser): orchestrator preventing iframe mouse interaction #5813
Changes from all commits
d9ad6c7
c1fda1f
1490e8e
b0d6b17
0e8c2c7
3e89822
db8bd26
d64ff33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<script setup lang="ts"> | ||
import { registerResizingListener } from '~/composables/client/resizing' | ||
|
||
const viewport = ref('custom') | ||
const resizingContainer = ref(false) | ||
|
||
function changeViewport(name: string) { | ||
if (viewport.value === name) { | ||
|
@@ -8,6 +11,12 @@ function changeViewport(name: string) { | |
viewport.value = name | ||
} | ||
} | ||
function onResizing(isResizing: boolean) { | ||
resizingContainer.value = isResizing | ||
} | ||
onMounted(() => { | ||
registerResizingListener(onResizing) | ||
}) | ||
</script> | ||
|
||
<template> | ||
|
@@ -61,30 +70,54 @@ function changeViewport(name: string) { | |
@click="changeViewport('tablet')" | ||
/> | ||
</div> | ||
<div flex-auto overflow-auto> | ||
<div id="tester-ui" class="flex h-full justify-center items-center font-light op70" style="overflow: auto; width: 100%; height: 100%" :data-viewport="viewport"> | ||
<div class="grid scrolls place-items-center" style="height: calc(100vh - 84px)"> | ||
<div | ||
id="tester-ui" | ||
class="flex font-light op70" | ||
:class="resizingContainer ? 'resizing': undefined" | ||
:data-viewport="viewport" | ||
> | ||
Select a test to run | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
#tester-ui.resizing iframe { | ||
pointer-events: none; | ||
} | ||
[data-viewport="custom"] { | ||
padding: 11px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need margins and paddings? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I intentionally removed all paddings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is about the 11px on the left resizer (avoid overlap) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can remove both margin and padding, shouldn't be a problem There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no overlap, the resizer appears on top of the panel |
||
} | ||
[data-viewport="custom"], | ||
[data-viewport="custom"] iframe { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
[data-viewport="small-mobile"] { | ||
margin: 11px; | ||
} | ||
[data-viewport="small-mobile"], | ||
[data-viewport="small-mobile"] iframe { | ||
width: 320px; | ||
height: 568px; | ||
} | ||
|
||
[data-viewport="large-mobile"] { | ||
margin: 11px; | ||
} | ||
[data-viewport="large-mobile"], | ||
[data-viewport="large-mobile"] iframe { | ||
width: 414px; | ||
height: 896px; | ||
} | ||
|
||
[data-viewport="tablet-mobile"] { | ||
margin: 11px; | ||
} | ||
[data-viewport="tablet"], | ||
[data-viewport="tablet"] iframe { | ||
width: 834px; | ||
height: 1112px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export type ResizingListener = (isResizing: boolean) => void | ||
|
||
const resizingSymbol = Symbol.for('resizing') | ||
|
||
export function registerResizingListener(listener: ResizingListener) { | ||
inject<(listener: ResizingListener) => void>(resizingSymbol)?.(listener) | ||
} | ||
|
||
export function provideResizing() { | ||
const listeners = new Set<ResizingListener>() | ||
|
||
function addResizeListener(listener: ResizingListener) { | ||
listeners.add(listener) | ||
} | ||
|
||
function notifyResizing(isResizing: boolean) { | ||
for (const listener of listeners) | ||
listener(isResizing) | ||
} | ||
|
||
provide(resizingSymbol, addResizeListener) | ||
|
||
return { notifyResizing } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this? Only the fallback text should be centered
iframe should touch every border
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it is always centered, the container and the iframe will have the same size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed also the overflow auto in the container and so centering the content doesn't matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the iframe should not be centered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain why you did it and not just state that you did it? I can see the code, I don't see why. The iframe was never meant to be centered