The modal functionality only seems to be working for the first message I send, as subsequent messages do not appear.
My environment includes: Angular 17 Bootstrap 5.3
This is the TypeScript file snippet:
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UserService } from '../../services/user/user.service';
import { iUserDTO } from '../../models/iUserDTO';
import * as bootstrap from 'bootstrap';
// Rest of the TypeScript code here...
Below is the HTML code where the issue persists with the close button appearing in the footer section:
<!-- users-add.component.html -->
<div class="container users-add">
<form [formGroup]="myForm" (ngSubmit)="onSubmit()">
<!-- Form fields and structure here -->
</form>
</div>
<!-- Modal Section -->
<div class="modal fade" id="errorModal" tabindex="-1" aria-labelledby="errorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal header, body, and footer details here -->
</div>
</div>
</div>
Despite troubleshooting my logic thoroughly, it appears that there might be a bug or inconsistency within Bootstrap causing this malfunction.
I have attempted various methods like resetting the form, clearing modal messages, and using dispose but haven't resolved the issue.
Interestingly, errors are correctly displayed when using existing data, yet if the data is altered, the modal gets stuck and shows the initial error message.