Skip to content

Commit 5da7845

Browse files
hawkgsAndrewKushnir
authored andcommitted
refactor(devtools): make devtools resizing in the demo app easier (angular#64307)
Set `pointer-events` of the `iframe` to `none` while dragging. This should stop the events context interference and make resizing of the panel easier. PR Close angular#64307
1 parent 6bc391c commit 5da7845

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

devtools/src/app/devtools-app/devtools-app.component.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
<as-split unit="percent" [direction]="'vertical'" [gutterSize]="9">
1+
<as-split
2+
unit="percent"
3+
[direction]="'vertical'"
4+
[gutterSize]="9"
5+
(dragStart)="resizingDevtools.set(true)"
6+
(dragEnd)="resizingDevtools.set(false)"
7+
>
28
<as-split-area size="40">
3-
<iframe #ref src="demo-app/todos/app" id="sample-app" title="todos-app"></iframe>
9+
<iframe
10+
#ref
11+
src="demo-app/todos/app"
12+
id="sample-app"
13+
title="todos-app"
14+
[style.pointer-events]="resizingDevtools() ? 'none' : 'auto'"
15+
></iframe>
416
</as-split-area>
517
<as-split-area size="60">
618
<div class="devtools-wrapper">

devtools/src/app/devtools-app/devtools-app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import {Component, ElementRef, viewChild} from '@angular/core';
9+
import {Component, ElementRef, signal, viewChild} from '@angular/core';
1010

1111
import {IFrameMessageBus} from '../../iframe-message-bus';
1212
import {DevToolsComponent} from '../../../projects/ng-devtools';
@@ -21,4 +21,5 @@ import {SplitComponent} from '../../../projects/ng-devtools/src/lib/shared/split
2121
export class AppDevToolsComponent {
2222
messageBus: IFrameMessageBus | null = null;
2323
readonly iframe = viewChild<ElementRef>('ref');
24+
readonly resizingDevtools = signal(false);
2425
}

0 commit comments

Comments
 (0)