Open fsiedler1 opened 10 months ago
Thanks for reporting this issue @fsiedler1 Before starting to analyze it, I can see that the repro uses v5.1.3. Is it also true for the latest Bootstrap version?
@julien-deramond I updated the REPL to the current version v5.3.2. It´s the same behaviour. https://blazorrepl.telerik.com/QdllvzYW01DHlNND09
Adding to the issue, this problem happens with pure bootstrap too.
If you have a popover with custom content inside a offcanvas element, the popover content can't be focused and it's useless.
Here's a reproduction CodePen showing the issue. Open the offcanvas, then open the popover content. The input is unfocusable.
I am getting a similar issue as well. In my case. I use angular material's mat-select
with an <input>
embedded inside of it like so:
`<mat-select [formControl]="control">
<mat-option *ngFor="let op of (filteredOptions$ | async)" [value]="op?.id">
{{op.name}}
</mat-option>
`
The mat-select
component opens fine, but when I click on the embedded input
element, it focuses on the [X] button of the offcanvas, similar to @fsiedler1 's reproduction
Bootstrap v.5.2.0
Same issue here, using CKEditor on off-canvas. Can't focus when trying to add a link to the content. It pops up a modal for url editing but can't focus on the url textbox, the focus just goes to the off-canvas instead.
I'm having the same problem with Syncfusion's SfDropDownList component.
Same issue here with a pivotgrid inside an offcanvas. When I tried to focus on the input textbot for a filter, the focus goes to the close button of the offcanvas.
I tried to add data-bs-focus="false"
to the close button but it did'nt work in my case
I was having the same issue on my side. As workaround I've created an offcanvas passing the config { scroll: true }
like:
const offcanvas = new bootstrap.Offcanvas(domEl, { scroll: true});
offcanvas.show();
This ☝🏻 prevented this line from executing, and solved the issue with focus. (Commenting if anyone still struggling with that), best regards.
I was having the same issue on my side. As workaround I've created an offcanvas passing the config
{ scroll: true }
like:const offcanvas = new bootstrap.Offcanvas(domEl, { scroll: true}); offcanvas.show();
This ☝🏻 prevented this line from executing, and solved the issue with focus. (Commenting if anyone still struggling with that), best regards.
Not working for me, thanks for sharing anyway
Prerequisites
Describe the issue
I created a offcanvas bootstrap dialog and integrated a telerik filterable dropdownlist. I realized, that any html element, which is outside of the canvas dialog is not able to be focused. The telerik filterable dropdownlist creates the selection with filter outside of the offcanvas. When the dropdownlist is clicked, the focus is set the the filter outside and is immediately closed by bootstrap, because the bootstrap offcanvas do not allow the focus.
I also created a modal dialog, where you can set the
data-bs-focus="false"
. With this configuration, it´s possible to open the dropdownlist.I need a data-bs-focus also for the offcanvas dialog, or any workaround.
Reduced test cases
I created a REPL, where the behvaiour can be reproduced: https://blazorrepl.telerik.com/mRPPFTYh25GOskeZ46
Edit by maintainer: Same version with v5.3.2: https://blazorrepl.telerik.com/QdllvzYW01DHlNND09
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.1.3