Skip to content

Commit

Permalink
feat(Split): resolve minimum setting conflict (#4180)
Browse files Browse the repository at this point in the history
* feat: 更新 tooltip 报错问题

* fix: 增加 border-style 样式

* refactor: 精简代码

* feat: 增加最小值冲突解决逻辑

* chore: bump version 8.8.5-beta08
  • Loading branch information
ArgoZhang authored Aug 29, 2024
1 parent 9241937 commit f0e630a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 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.5-beta07</Version>
<Version>8.8.5-beta08</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
Expand Down
10 changes: 9 additions & 1 deletion src/BootstrapBlazor/Components/Split/Split.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ export function init(id, invoke, method, option) {
}

const min = getMin(split);
const max = getMax(split);
let max = getMax(split);

if (min < 100 - max) {
max = 100;
}
if (newVal <= min) newVal = min
if (newVal >= max) newVal = max

Expand Down Expand Up @@ -86,6 +89,11 @@ export function init(id, invoke, method, option) {
});
};

const basis = parseFloat(splitLeft.style.flexBasis);
const min = getMin(split);
if (basis < min) {
splitLeft.style.flexBasis = `${min}%`;
}
split.initCollapseButton();
}

Expand Down
5 changes: 2 additions & 3 deletions src/BootstrapBlazor/Components/Split/Split.razor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@

.split-bar-arrow {
background-color: var(--bb-split-bar-arrow-hover-bg);
border-color: var(--bb-split-bar-arrow-hover-border-color);
border-width: 1px;
border: 1px solid var(--bb-split-bar-arrow-hover-border-color);

&:before,
&:after {
Expand Down Expand Up @@ -222,7 +221,7 @@
.split-bar-arrow {
background-color: var(--bb-split-bar-arrow-bg);
border-color: var(--bb-split-bar-arrow-border-color);
transition: background-color 500ms ease-out;
transition: background-color .5s ease-out;
border-radius: 50%;
border-image: none;
border-width: 1px;
Expand Down
5 changes: 3 additions & 2 deletions src/BootstrapBlazor/Components/Tooltip/Tooltip.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ export function dispose(id) {
const tip = Data.get(id)
Data.remove(id)

if (tip) {
if (tip && tip.tooltip) {
const timeout = tip.tooltip._config.trigger.includes("focus") ? 300 : 0
const handler = setTimeout(() => {
clearTimeout(handler)
if (tip.tooltip) {
tip.tooltip.dispose()
delete tip.tooltip
}
}, 10)
}, timeout)
}
}

0 comments on commit f0e630a

Please sign in to comment.