Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>10.2.1-beta01</Version>
<Version>10.2.1-beta02</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions src/BootstrapBlazor/Components/Table/Table.razor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { getResponsive } from '../../modules/responsive.js'
import { copy, drag, getDescribedElement, getOuterHeight, getWidth, isVisible } from '../../modules/utility.js'
import '../../modules/browser.js'
import browser from '../../modules/browser.min.mjs'
import Data from '../../modules/data.js'
import EventHandler from '../../modules/event-handler.js'
import Popover from "../../modules/base-popover.js"
Expand Down Expand Up @@ -54,7 +54,7 @@ export function saveColumnOrder(options) {
localStorage.setItem(key, JSON.stringify(options.columns));
}

export function reset(id) {
export async function reset(id) {
const table = Data.get(id)
if (table === null) {
return;
Expand All @@ -79,7 +79,7 @@ export function reset(id) {
table.tables.push(table.thead.firstChild)
table.tables.push(table.body.firstChild)
table.scrollWidth = parseFloat(table.body.style.getPropertyValue('--bb-scroll-width'));
fixHeader(table)
await fixHeader(table);

EventHandler.on(table.body, 'scroll', () => {
const left = table.body.scrollLeft
Expand Down Expand Up @@ -388,7 +388,7 @@ const setBodyHeight = table => {
}
}

const fixHeader = table => {
const fixHeader = async table => {
const el = table.el
const fs = el.querySelector('.fixed-scroll')

Expand All @@ -398,8 +398,8 @@ const fixHeader = table => {
if (prev.classList.contains('fixed-right') && !prev.classList.contains('modified')) {
let margin = prev.style.right
margin = margin.replace('px', '')
const b = window.browser()
if (b.device !== 'PC') {
const b = await browser.getInfo();
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to browser.getInfo() is made without parameters, but in client.js the same method is called with parameters: browser.getInfo(['browser', 'system', 'device', 'language']). According to the browser-tool library API, both usages are valid - calling without parameters will fetch all available information. However, for consistency and performance, consider specifying only the needed properties. In this case, only the 'device' property is needed, so the call could be optimized to browser.getInfo(['device']).

Suggested change
const b = await browser.getInfo();
const b = await browser.getInfo(['device']);

Copilot uses AI. Check for mistakes.
if (b.device !== 'Desktop') {
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device type comparison has been changed from 'PC' to 'Desktop' to match the new browser detection library's return value. However, this hardcoded string should ideally match the enum value in WebClientDeviceType.cs. Since the C# enum now uses Desktop instead of PC, this change maintains consistency. Consider using a constant or enum value instead of a magic string to prevent future inconsistencies.

Copilot uses AI. Check for mistakes.
margin = (parseFloat(margin) - table.scrollWidth) + 'px'
}
prev.classList.add('modified')
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Enums/WebClientDeviceType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
Expand All @@ -13,7 +13,7 @@ public enum WebClientDeviceType
/// <summary>
///
/// </summary>
PC,
Desktop,
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum value has been renamed from PC to Desktop. This is a breaking change that could affect existing code that references WebClientDeviceType.PC. While the new name Desktop is more descriptive and aligns with modern terminology, this change should be clearly documented as a breaking change in the release notes, and consumers of this API will need to update their code.

Copilot uses AI. Check for mistakes.

/// <summary>
///
Expand Down
Loading
Loading