Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion src/Core/Components/DataGrid/FluentDataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@

@if (ResizableColumns)
{
<div class="resize-handle"></div>
var top = DisplayMode == DataGridDisplayMode.Table ? "top: 4px;" : "top: 2px;";
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
<div class="resize-handle" style="@top"></div>
}
</FluentDataGridCell>
}
Expand Down
1 change: 0 additions & 1 deletion src/Core/Components/DataGrid/FluentDataGrid.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

::deep .resize-handle {
position: absolute;
top: 5px;
right: 0;
left: unset;
bottom: 0;
Expand Down
13 changes: 8 additions & 5 deletions src/Core/Components/DataGrid/FluentDataGrid.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function enableColumnResizing(gridElement, resizeColumnOnAllRows = true)
if (!resizeColumnOnAllRows) {
// Only use the header height when resizeColumnOnAllRows is false
// Use the first header's height if available
resizeHandleHeight = headers.length > 0 ? (headers[0].offsetHeight - 14 ): 30; // fallback to 30px if no headers
resizeHandleHeight = headers.length > 0 ? (headers[0].offsetHeight - 14 ): 32; // fallback to 30px if no headers
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
}

headers.forEach((header) => {
Expand All @@ -201,8 +201,11 @@ export function enableColumnResizing(gridElement, resizeColumnOnAllRows = true)
const resizedivs = header.querySelectorAll(".actual-resize-handle");
resizedivs.forEach(div => div.remove());

// Get the top of the first resize-handle
const resizeTop = header.querySelector('.resize-handle').offsetTop;
Comment thread
vnbaaij marked this conversation as resolved.

// add a new resize div
const div = createDiv(resizeHandleHeight, isRTL);
const div = createDiv(resizeHandleHeight, resizeTop, isRTL);
header.appendChild(div);
setListeners(div, isRTL);
});
Expand Down Expand Up @@ -283,14 +286,14 @@ export function enableColumnResizing(gridElement, resizeColumnOnAllRows = true)
});
}

function createDiv(height, isRTL) {
function createDiv(height, top, isRTL) {
const div = document.createElement('div');
div.className = "actual-resize-handle";
div.style.top = '5px';
div.style.top = top + 'px';
div.style.position = 'absolute';
div.style.cursor = 'col-resize';
div.style.userSelect = 'none';
div.style.height = (height - 5) + 'px';
div.style.height = (height - 4) + 'px';
Comment thread
vnbaaij marked this conversation as resolved.
div.style.width = '6px';
div.style.opacity = 'var(--fluent-data-grid-header-opacity)'

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/DataGrid/FluentDataGridCell.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public partial class FluentDataGridCell<TGridItem> : FluentComponentBase
.AddStyle("height", $"{Grid.ItemSize:0}px", () => !Grid.EffectiveLoadingValue && Grid.Virtualize)
.AddStyle("height", $"{(int)Grid.RowSize}px", () => !Grid.EffectiveLoadingValue && !Grid.Virtualize && !Grid.MultiLine && (Grid.Items is not null || Grid.ItemsProvider is not null) && InternalGridContext.TotalItemCount > 0)
.AddStyle("height", "100%", Grid.MultiLine)
.AddStyle("min-height", "44px", Owner.RowType != DataGridRowType.Default)
.AddStyle("min-height", "40px", Owner.RowType != DataGridRowType.Default)
.AddStyle("z-index", ZIndex.DataGridHeaderPopup.ToString(), CellType == DataGridCellType.ColumnHeader && Grid._columns.Count > 0 && Grid.UseMenuService)
.AddStyle(Owner.Style)
.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ td.grid-cell-placeholder:after {
font-weight: 600;
text-align: center;
position: relative;
padding: calc((var(--design-unit) + var(--focus-stroke-width) - var(--stroke-width)) * 1px) 1px calc((var(--design-unit) + var(--focus-stroke-width) - var(--stroke-width)) * 1px);
}

::deep .col-sort-button {
Expand Down
Loading