I'd like to have a clickable icon as part of a form-floating label but the label seems to be rendered behind the input.
I tried playing with z-index without any luck and I'm not sure what else I can do to fix the problem. Could someone point me in the right direction?
https://blazorfiddle.com/s/y4143uso

The "Test" button and icon on its own (col#3, col#4) work, but the first two col's with form-floating examples won't redirect when the icon is clicked.
@page "/"
@inject NavigationManager NavigationManager
<div class="container-fluid">
<div class="row">
<div class="col-1">
<div class="form-floating">
<input type="text" class="form-control" placeholder="bla">
<label>LABEL<i class="fas fa-info-circle ps-1" @onclick="Test"></i></label>
</div>
</div>
<div class="col-1">
<div class="form-floating">
<input type="text" class="form-control" value="blabla">
<label>LABEL<i class="fas fa-info-circle ps-1" @onclick="Test"></i></label>
</div>
</div>
<div class="col-1">
<button type="button" class="btn btn-sm btn-primary" @onclick="Test">Test</button>
</div>
<div class="col-1">
<i class="fas fa-info-circle ps-1" @onclick="Test"></i>
</div>
</div>
</div>
@code {
void Test()
{
NavigationManager.NavigateTo("https://google.com");
}
}
You have to handle pointer-events belong to child labels. If a click event does not occur, firstly you should think about pointer-events.
.clickable-icon{
pointer-events: auto !important; // required
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="container my-2">
<div class="form-floating">
<input type="text" class="form-control" id="floatingInput" placeholder="Click Icons" value="Click Icons">
<label for="floatingInput">Clickable Icon <label class="clickable-icon" onclick="alert('hello')">😀</label> <label class="clickable-icon ms-1" onclick="alert('clicked')">⚡</label></label>
</div>
</div>