Skip to content

Commit 6a3df54

Browse files
fix(FullScreenService): sync fullscreen state with esc key event (#5961)
* style: 移除不使用的样式 * feat: 增加 fullscreenchange 状态监控 * refactor: 精简代码 * refactor: 重构样式 * doc: 更新文档 * chore: bump version 9.6.1-beta03 * chore: bump version 9.6.1-beta02 Co-Authored-By: WarriorBlue <[email protected]> --------- Co-authored-by: WarriorBlue <[email protected]>
1 parent a48cdef commit 6a3df54

File tree

5 files changed

+14
-24
lines changed

5 files changed

+14
-24
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.6.1-beta01</Version>
4+
<Version>9.6.1-beta02</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/FullScreen/FullScreenButton.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class FullScreenButton
1414
/// 获得/设置 退出全屏图标 默认 fa-solid fa-maximize
1515
/// </summary>
1616
[Parameter]
17-
[Obsolete("已启用,请使用 Icon 参数 Please use Icon parameter")]
17+
[Obsolete("已弃用,请使用 Icon 参数;Deprecated. Please use Icon parameter")]
1818
[ExcludeFromCodeCoverage]
1919
public string? FullScreenIcon { get => FullScreenExitIcon; set => FullScreenExitIcon = value; }
2020

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
.bb-fs-on,
2-
.bb-fs-open .bb-fs-off {
1+
.bb-fs-on {
32
display: none;
43
}
54

6-
.bb-fs-open .bb-fs-on {
5+
.bb-fs-off {
76
display: inline-block;
87
}
8+
9+
:not(:root):fullscreen {
10+
.bb-fs-on {
11+
display: inline-block;
12+
}
13+
14+
.bb-fs-off {
15+
display: none;
16+
}
17+
}

src/BootstrapBlazor/Components/Tab/Tab.razor.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636

3737
.tabs-body-content {
3838
background-color: var(--bs-body-bg);
39-
40-
&.bb-fs-open {
41-
padding: var(--bb-tabs-body-padding);
42-
overflow: auto;
43-
}
4439
}
4540
}
4641

src/BootstrapBlazor/wwwroot/modules/fullscreen.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,10 @@ export async function toggle(options) {
2525

2626
const enterFullscreen = async el => {
2727
await el.requestFullscreen();
28-
29-
updateFullscreenState(el);
3028
}
3129

3230
const exitFullscreen = async el => {
3331
await document.exitFullscreen()
34-
35-
updateFullscreenState(el);
36-
}
37-
38-
const updateFullscreenState = el => {
39-
if (isFullscreen()) {
40-
el.classList.add('bb-fs-open')
41-
}
42-
else {
43-
el.classList.remove('bb-fs-open');
44-
document.documentElement.classList.remove('bb-fs-open');
45-
}
4632
}
4733

4834
const isFullscreen = () => {

0 commit comments

Comments
 (0)