Skip to content

Commit

Permalink
fix: column resizing in rtl direction
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Jan 17, 2022
1 parent 4549a51 commit 95a2399
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ <h1>Frappé DataTable</h1>
dynamicRowHeight: true,
treeView: treeView,
showTotalRow: true,
// direction: 'rtl',
// language: 'myLang',
// translations: {
// myLang: {
Expand Down
6 changes: 5 additions & 1 deletion src/columnmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ export default class ColumnManager {

const onMouseMove = (e) => {
if (!isDragging) return;
const finalWidth = startWidth + (e.pageX - startX);
let delta = e.pageX - startX;
if (this.options.direction === 'rtl') {
delta = -1 * delta;
}
const finalWidth = startWidth + delta;
const {
colIndex
} = $.data($resizingCell);
Expand Down
5 changes: 5 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@
}
}

.datatable[dir=rtl] .dt-cell__resize-handle {
right: unset;
left: -3px;
}

.icon-open, .icon-close {
width: 16px;
height: 16px;
Expand Down

0 comments on commit 95a2399

Please sign in to comment.