Skip to content

Commit

Permalink
Fix Dropdowns of editors do not scroll with the page (T1188807). (#189)
Browse files Browse the repository at this point in the history
* Fix Dropdowns of editors do not scroll with the page (T1188807).

Fire scroll event from body to force hiding opened editors dropdowns, because <body> is theirs scroll parent
  • Loading branch information
GoodDayForSurf authored Sep 19, 2023
1 parent 8b8df62 commit 1a0dc7b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/left-menu/main/left-menu.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="left-menu">
<div class="working-area">
<div class="scroll-container" *ngIf="workArea">
<dx-scroll-view>
<dx-scroll-view (onScroll)="fireScrollEventForClosingDropdowns()">
<div *ngFor="let data of filteredData">
<div class="name top search-active" *ngIf="searchOpened">
<div class="link-handler" [routerLink]="['/advanced', theme, colorScheme, data.route]"></div>
Expand Down Expand Up @@ -46,7 +46,7 @@
<div>
<app-back-navigator text="Back"></app-back-navigator>
</div>

</div>
<div class="separator"></div>
<div class="scroll-container">
Expand Down
4 changes: 4 additions & 0 deletions src/app/left-menu/main/left-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ export class LeftMenuComponent implements OnDestroy, OnInit {
});
}

fireScrollEventForClosingDropdowns() {
document.body.dispatchEvent(new Event('scroll'));
}

ngOnDestroy(): void {
this.subscription.unsubscribe();
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/preview/editors/editors.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dx-text-box>
</div>
<div class="field daterangebox">
<dx-date-range-box stylingMode="outlined"></dx-date-range-box>
<dx-date-range-box stylingMode="outlined" [dropDownOptions]="dropDownOptions"></dx-date-range-box>
</div>
</div>
<div class="block filled">
Expand Down Expand Up @@ -70,7 +70,7 @@
</dx-text-box>
</div>
<div class="field daterangebox">
<dx-date-range-box stylingMode="filled"></dx-date-range-box>
<dx-date-range-box stylingMode="filled" [dropDownOptions]="dropDownOptions"></dx-date-range-box>
</div>
</div>
<div class="block underlined">
Expand Down Expand Up @@ -100,7 +100,7 @@
</dx-text-box>
</div>
<div class="field daterangebox">
<dx-date-range-box stylingMode="underlined"></dx-date-range-box>
<dx-date-range-box stylingMode="underlined" [dropDownOptions]="dropDownOptions"></dx-date-range-box>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/preview/editors/editors.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class EditorsComponent implements OnInit, OnDestroy {
widgetGroup = 'editors';
isExpanded = new BehaviorSubject<boolean>(false);
subscription: Subscription;

dropDownOptions = {hideOnParentScroll: true};
labelMode = 'floating';

ngOnInit(): void {
Expand Down
6 changes: 3 additions & 3 deletions src/app/preview/preview/preview.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<dx-scroll-view #scrollView class="preview-scrollview">
<dx-scroll-view #scrollView class="preview-scrollview" (onScroll)="fireScrollEventForClosingDropdowns()">
<div class="flex-container">
<div class="flex-item group">
<div class="flex-item">
Expand Down Expand Up @@ -51,7 +51,7 @@
<app-form #widget></app-form>
</div>
</div>
<div class="flex-item">
<div class="flex-item">
<app-button-detailed widget="list" [currentWidget]="widgetName" (clicked)="buttonDetailedClick($event)"></app-button-detailed>
<div class="flex-label">LIST</div>
<div class="flex-value">
Expand Down Expand Up @@ -110,7 +110,7 @@
<app-tabs #widget></app-tabs>
</div>
</div>
</div>
</div>
<div class="flex-item group">
<div class="flex-item">
<app-button-detailed widget="progressbars" [currentWidget]="widgetName" (clicked)="buttonDetailedClick($event)"></app-button-detailed>
Expand Down
4 changes: 4 additions & 0 deletions src/app/preview/preview/preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@ export class PreviewComponent implements AfterViewInit, OnChanges {
ngAfterViewInit(): void {
this.createPreviewContent(this.widgetName);
}

fireScrollEventForClosingDropdowns() {
document.body.dispatchEvent(new Event('scroll'));
}
}

0 comments on commit 1a0dc7b

Please sign in to comment.