Skip to content

Commit

Permalink
Fix column resizing when in rtl mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Oct 22, 2024
1 parent 7060116 commit bca8540
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/Demo/Shared/Pages/Lab/IssueTester.razor
Original file line number Diff line number Diff line change
@@ -1 +1 @@


9 changes: 8 additions & 1 deletion src/Core/Components/DataGrid/FluentDataGrid.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ export function enableColumnResizing(gridElement) {
}

const horizontalScrollOffset = document.documentElement.scrollLeft;
const width = (horizontalScrollOffset + e.clientX) - headerBeingResized.offsetLeft;
let width;

if (document.body.dir === '' || document.body.dir === 'ltr') {
width = (horizontalScrollOffset + e.clientX) - headerBeingResized.offsetLeft;
}
else {
width = headerBeingResized.offsetLeft + headerBeingResized.clientWidth - (horizontalScrollOffset + e.clientX);
}

const column = columns.find(({ header }) => header === headerBeingResized);
column.size = Math.max(minWidth, width) + 'px';
Expand Down

0 comments on commit bca8540

Please sign in to comment.