Skip to content

Commit e035001

Browse files
yuriy-fixweb-padawan
authored andcommitted
Add rtl resizing and navigation implementation
1 parent 0269bad commit e035001

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
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+
const maxWidth = targetCell.offsetWidth + (this.__isRTL ? targetCell.getBoundingClientRect().left - e.detail.x :
60+
e.detail.x - targetCell.getBoundingClientRect().right);
61+
column.width = Math.max(minWidth, maxWidth) + 'px';
6062
column.flexGrow = 0;
6163
}
6264
// 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)