Skip to content

Commit 1b10325

Browse files
committed
Add rtl resizing and navigation implementation
1 parent 3badb89 commit 1b10325

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/vaadin-grid-column-resizing-mixin.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@
5656
var style = window.getComputedStyle(targetCell);
5757
var minWidth = 10 + parseInt(style.paddingLeft) + parseInt(style.paddingRight) + parseInt(style.borderLeftWidth)
5858
+ parseInt(style.borderRightWidth) + parseInt(style.marginLeft) + parseInt(style.marginRight);
59-
column.width = Math.max(minWidth, targetCell.offsetWidth + e.detail.x - targetCell.getBoundingClientRect().right) + 'px';
59+
if (this.__isRTL) {
60+
column.width = Math.max(minWidth, targetCell.offsetWidth + targetCell.getBoundingClientRect().left - e.detail.x) + 'px';
61+
} else {
62+
column.width = Math.max(minWidth, targetCell.offsetWidth + e.detail.x - targetCell.getBoundingClientRect().right) + 'px';
63+
}
6064
column.flexGrow = 0;
6165
}
6266
// Fix width and flex-grow for all preceding columns

src/vaadin-grid-keyboard-navigation-mixin.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@
139139
let dx = 0, dy = 0;
140140
switch (key) {
141141
case 'ArrowRight':
142-
dx = 1;
142+
dx = this.__isRTL ? -1 : 1;
143143
break;
144144
case 'ArrowLeft':
145-
dx = -1;
145+
dx = this.__isRTL ? 1 : -1;
146146
break;
147147
case 'Home':
148148
dx = -Infinity;

0 commit comments

Comments
 (0)