Skip to content

Commit

Permalink
fix(Modal): remove focustrap function (#1534)
Browse files Browse the repository at this point in the history
* revert: 撤销 Filter 脚本获得焦点逻辑

* fix: remove focustrap function

* chore: bump version 7.8.5
  • Loading branch information
ArgoZhang authored Jul 11, 2023
1 parent e1a3857 commit ef653e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>7.8.5-beta03</Version>
<Version>7.8.5</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
Expand Down
7 changes: 0 additions & 7 deletions src/BootstrapBlazor/Components/Filters/TableFilter.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ export function init(id) {
buttons.item(1).click()
}
});

// hack input in modal
tableFilter.body = el.querySelector('.card-body')
EventHandler.on(tableFilter.body, 'focusin', 'input', e => {
e.stopPropagation()
})
}

export function dispose(id) {
Expand All @@ -55,6 +49,5 @@ export function dispose(id) {
if (tableFilter) {
EventHandler.off(tableFilter.action, 'click', tableFilter.dismissSelector)
Popover.dispose(tableFilter.dropdown)
EventHandler.off(tableFilter.body, 'focusin')
}
}
2 changes: 2 additions & 0 deletions src/BootstrapBlazor/Components/Modal/Modal.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export function init(id, invoke, shownCallback, closeCallback) {
}
if (!modal.modal) {
modal.modal = bootstrap.Modal.getOrCreateInstance(el)
// hack: fix focusin event
modal.modal._focustrap._handleFocusin = e => { }
}
modal.modal._config.keyboard = el.getAttribute('data-bs-keyboard') === 'true'
modal.modal._config.backdrop = backdrop
Expand Down

0 comments on commit ef653e6

Please sign in to comment.