Skip to content

Commit

Permalink
fix(Split): mask not removed after drag (#4122)
Browse files Browse the repository at this point in the history
* refactor: 更新遮罩逻辑

* chore: bump version 8.8.4-beta05
  • Loading branch information
ArgoZhang authored Aug 22, 2024
1 parent e207c5b commit f75d09f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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>8.8.4-beta04</Version>
<Version>8.8.4-beta05</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
Expand Down
13 changes: 5 additions & 8 deletions src/BootstrapBlazor/Components/Split/Split.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export function init(id) {
const splitRight = splitWrapper.children[2];

split.splitBar = splitBar;
EventHandler.on(splitBar, 'mousedown', e => showMask(splitLeft, splitRight));
EventHandler.on(splitBar, 'mouseup', e => removeMask(splitLeft, splitRight));

Drag.drag(splitBar,
e => {
splitWidth = el.offsetWidth
Expand All @@ -39,7 +36,8 @@ export function init(id) {
originX = e.clientX || e.touches[0].clientX
curVal = splitLeft.offsetWidth * 100 / splitWidth
}
el.classList.add('dragging')
el.classList.add('dragging');
showMask(splitLeft, splitRight);
},
e => {
if (isVertical) {
Expand All @@ -58,7 +56,8 @@ export function init(id) {
splitRight.style.flexBasis = `${100 - newVal}%`
},
() => {
el.classList.remove('dragging')
el.classList.remove('dragging');
removeMask(splitLeft, splitRight);
})
}

Expand Down Expand Up @@ -89,9 +88,7 @@ export function dispose(id) {
Data.remove(id)

if (split) {
const { el, splitBar } = split;
EventHandler.on(splitBar, 'mousedown');
EventHandler.on(splitBar, 'mouseup');
const { el } = split;
Drag.dispose(el)
}
}

0 comments on commit f75d09f

Please sign in to comment.