Skip to content

Commit

Permalink
Add rtl resizing and navigation implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix authored and web-padawan committed Apr 8, 2020
1 parent 0269bad commit e035001
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/vaadin-grid-column-resizing-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
var style = window.getComputedStyle(targetCell);
var minWidth = 10 + parseInt(style.paddingLeft) + parseInt(style.paddingRight) + parseInt(style.borderLeftWidth)
+ parseInt(style.borderRightWidth) + parseInt(style.marginLeft) + parseInt(style.marginRight);
column.width = Math.max(minWidth, targetCell.offsetWidth + e.detail.x - targetCell.getBoundingClientRect().right) + 'px';
const maxWidth = targetCell.offsetWidth + (this.__isRTL ? targetCell.getBoundingClientRect().left - e.detail.x :
e.detail.x - targetCell.getBoundingClientRect().right);
column.width = Math.max(minWidth, maxWidth) + 'px';
column.flexGrow = 0;
}
// Fix width and flex-grow for all preceding columns
Expand Down
4 changes: 2 additions & 2 deletions src/vaadin-grid-keyboard-navigation-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
let dx = 0, dy = 0;
switch (key) {
case 'ArrowRight':
dx = 1;
dx = this.__isRTL ? -1 : 1;
break;
case 'ArrowLeft':
dx = -1;
dx = this.__isRTL ? 1 : -1;
break;
case 'Home':
dx = -Infinity;
Expand Down

0 comments on commit e035001

Please sign in to comment.