Incorporating Bootstrap 5, my goal is to enhance the user experience by adding a close button to form floating and form control input fields for easy text clearing on mobile devices. However, the implementation is not functioning as anticipated. I am seeking a simple 'x' symbol positioned at the right end of the input fields, similar to the search field example highlighted here.
Below is a basic reproduction of the examples from the documentation with the expected close button included:
<head>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="67050808131413150617275249564957">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
</head>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInput" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3658575b5376534e575b465a531855595b">[email protected]</a>">
<button type="button" class="btn-close" disabled aria-label="Close"></button>
<label for="floatingInput">Email address</label>
</div>
<div class="mb-3">
<label for="exampleFormControlInput1" class="form-label">Email address</label>
<button type="button" class="btn-close" disabled aria-label="Close"></button>
<input type="email" class="form-control" id="exampleFormControlInput1" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d737c70785d78657c706d7178337e7270">[email protected]</a>">
</div>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8eece1e1fafdfafceffecebba0bea0bea3ecebfaefbc">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
</html>
What could be the issue with my approach?
I acknowledge that I might be missing something obvious, as I haven't come across any Bootstrap 5 examples addressing this specific functionality. Please excuse the simple question.