Skip to content

Commit

Permalink
Feature(402675):dropdown correction
Browse files Browse the repository at this point in the history
  • Loading branch information
GowthamKumarMVS committed Dec 27, 2024
1 parent b97922d commit 638c50e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@
<button ejs-button cssClass="e-primary" style="width: 75%;">{{$index+1}}.{{option.label}}</button>
@if(checkBranchAdd(data.data.branchDetails, option.value)){
<div class="dropDown-container{{$index}}">
<button (click)="onClick">Click</button>
<button #dropdownbutton id="dropdownbutton-{{$index}}" ejs-dropdownbutton target="#listview"
(open)="onOpenDropDownButton1($event, option, $index)" iconCss='e-icons e-plus' cssClass='e-caret-hide'
(open)="onOpenDropDownButton($event, option, $index)" iconCss='e-icons e-plus' cssClass='e-caret-hide'
(beforeClose)="onBeforeCloseDropDownButton($event)" (beforeOpen)="onBeforeOpenDropDownButton()"></button>
</div>
}
Expand Down
21 changes: 8 additions & 13 deletions src/app/components/workflow-diagram/workflow-diagram.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,26 +284,21 @@ export class WorkflowDiagramComponent implements AfterViewInit {
}
}

public onOpenDropDownButton(args: OpenCloseMenuEventArgs) {
console.log("Drop :" + args.element );

public onOpenDropDownButton(args: OpenCloseMenuEventArgs, option: any | null, index: number | null) : void {
if(index!=null){
this.dropdownbutton.toggle();
if(this.diagram.selectedItems.userHandles){
this.diagram.selectedItems.userHandles[1].visible = false;
this.diagram.selectedItems.userHandles[2].visible = false;
}
}
let dropDownContainer = document.querySelector('.dropDown-container') as HTMLElement;
args.element.parentElement!.style.top = dropDownContainer.getBoundingClientRect().top + dropDownContainer.offsetHeight +'px';

let ulElement = document.querySelector('ul') as HTMLElement;
args.element.parentElement!.style.left = dropDownContainer.getBoundingClientRect().left - (ulElement.getBoundingClientRect().width / 2)+ (dropDownContainer.getBoundingClientRect().width / 2)+'px' ;
}

public onOpenDropDownButton1(args: OpenCloseMenuEventArgs, option: any, index: number) {
console.log("Option Selected:", option);
console.log("Index:", index);
this.dropdownbutton.toggle();
if(this.diagram.selectedItems.userHandles){
this.diagram.selectedItems.userHandles[1].visible = false;
this.diagram.selectedItems.userHandles[2].visible = false;
}
}

public onBeforeCloseDropDownButton(args: BeforeOpenCloseMenuEventArgs) {
args.cancel = this.isParentListItem;
if (!(this.isParentListItem || ((args.event.target as HTMLElement).closest(".bc-block-option.e-listview")==null))) {
Expand Down

0 comments on commit 638c50e

Please sign in to comment.