I have issue in displaying drop dowm data within input form. Once I select drop down its showing in background. My code is below. Please advice.
<div class="modal fade" id="kt_modal_add_customer" tabindex="-1" aria-hidden="true">
<!--begin::Modal dialog-->
<div class="modal-dialog modal-dialog-centered mw-650px">
<!--begin::Modal content-->
<div class="modal-content">
<!--begin::Form-->
<form [formGroup]="formData" class="form" action="#" id="kt_modal_add_customer_form" >
<!--begin::Modal header-->
<div class="fv-row mb-7">
<!--begin::Label-->
<label class="required fs-6 fw-semibold mb-2">Lead Targets</label> <br/>
<mat-select class="form-select" [formControl]="custCtrl" placeholder="Data" #singleSelect>
<mat-option >
<ngx-mat-select-search
[formControl]="custromerFilterCtrl"
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let customer of filteredCustomers | async" [value]="customer">
{{customer.Name}}
</mat-option>
</mat-select>
<!--end::Input-->
</div>
</form>
<!--end::Form-->
</div>
</div>
Hi Faqru,
Based on the information provided, it seems that the issue you are facing is related to the positioning or z-index of the dropdown menu within the modal. Here are a few suggestions to resolve the problem:
1. Ensure that there are no conflicting CSS rules or styles that are affecting the positioning of the dropdown. Inspect the CSS styles applied to the dropdown and the modal to identify any conflicts. You can use browser developer tools to help with this.
2. Try explicitly setting the z-index of the dropdown menu to a higher value than the modal or other elements that might be overlapping. You can do this by adding a CSS class to the dropdown and applying the z-index property. For example:
.dropdown-menu {
z-index: 9999;
}
Hello Faizal,
Thanks for your reply. I can see drop down from mat selection and everything I import correctly. I tested in normal html with angular ts and it works as expected. But once I use matselection in html <form class="form" action="#"> the results is different. It shows dropdown in the background not within the kt_modal_new_target_form. Please find below links for output and html code. I need drop down selection within the creation form.
https://drive.google.com/file/d/1enFj9hUSETYbz_oL6EEIeVJs7kz2sT6F/view?usp=share_link
https://drive.google.com/file/d/1NsB_1_d6mkwKincgNBa6npwrV-tC4nIP/view?usp=share_link
Hi Faqru,
Ensure that you have imported the necessary modules in your Angular module file. Make sure you have imported MatSelectModule and FormsModule from '@angular/material' and '@angular/forms', respectively.
Double-check if there are any conflicting styles or CSS rules that may be affecting the display of the dropdown. Inspect the browser's developer tools to identify any potential CSS conflicts or layout issues.
If the issue persist, please provide more details or any error messages you may be encountering for further assistance.
Thanks