Skip to content

Commit fa33e44

Browse files
JamesPortellirossjp
authored andcommitted
Release 5.0.5 -> Master (adazzle#1425)
* Cell Tooltip - Focus Issues (adazzle#1422) * change level tooltip gets rendered and level it gets triggered * remove unsed editors and fix imports. * re order inclusion of frozen cells to avoid z-index css. * address comments * Revert "remove unsed editors and fix imports." This reverts commit 3b22f60. * fix issues * fix issues * remove extra space * fix: draggable resizing col jumps to right (adazzle#1421) * fix: draggable resizing col jumps to right * refactor: use ref instead of findDOMNode * fix: accidentally removed cel * Release 5.0.5 (adazzle#1424) * update changelog * Version bump to 5.0.5 [ci skip] * revert auto file changes * address aman comments
1 parent 3fac3f4 commit fa33e44

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

docs/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ id: changelog
33
title: Changelog
44
---
55

6+
## 5.0.5 (Dec 6, 2018)
7+
- **Bugfix:** fix: draggable resizing col jumps to right ([1421](https://github.com/adazzle/react-data-grid/pull/1421))
8+
- **Bugfix:** Cell Tooltip - Focus Issues ([1422](https://github.com/adazzle/react-data-grid/pull/1422))
9+
610
## 6.0.1 (Nov 30, 2018)
711
- **Bugfix:** Fix formatter exports ([1409](https://github.com/adazzle/react-data-grid/pull/1409))
812

packages/react-data-grid/src/Cell.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Cell extends React.PureComponent {
172172
const extraClasses = joinClasses({
173173
'row-selected': this.props.isRowSelected,
174174
editing: this.isEditorEnabled(),
175-
'cell-tooltip': this.props.tooltip ? true : false,
175+
'has-tooltip': this.props.tooltip ? true : false,
176176
'rdg-child-cell': this.props.expandableOptions && this.props.expandableOptions.subRowDetails && this.props.expandableOptions.treeDepth > 0,
177177
'last-column': this.props.column.isLastColumn
178178
});
@@ -315,13 +315,20 @@ class Cell extends React.PureComponent {
315315
if (treeDepth > 0 && isExpandCell) {
316316
cellDeleter = <ChildRowDeleteButton treeDepth={treeDepth} cellHeight={this.props.height} siblingIndex={this.props.expandableOptions.subRowDetails.siblingIndex} numberSiblings={this.props.expandableOptions.subRowDetails.numberSiblings} onDeleteSubRow={this.onDeleteSubRow} isDeleteSubRowEnabled={isDeleteSubRowEnabled} />;
317317
}
318+
319+
const tooltip = this.props.tooltip && (<span className="cell-tooltip-text">{this.props.tooltip}</span>);
320+
const classes = joinClasses('react-grid-Cell__value',
321+
{ 'cell-tooltip': this.props.tooltip ? true : false }
322+
);
323+
318324
return (
319-
<div className="react-grid-Cell__value">
325+
<div className={classes}>
320326
{cellDeleter}
321327
<div style={{ marginLeft, position: 'relative', top: '50%', transform: 'translateY(-50%)' }}>
322328
<span>{CellContent}</span>
323329
{this.props.cellControls}
324330
</div>
331+
{tooltip}
325332
</div>
326333
);
327334
};
@@ -346,7 +353,6 @@ class Cell extends React.PureComponent {
346353
});
347354

348355
const events = this.getEvents();
349-
const tooltip = this.props.tooltip ? (<span className="cell-tooltip-text">{this.props.tooltip}</span>) : null;
350356

351357
const cellExpander = this.canExpand() && (
352358
<CellExpand expandableOptions={this.props.expandableOptions} onCellExpand={this.onCellExpand} />
@@ -363,7 +369,6 @@ class Cell extends React.PureComponent {
363369
{cellActionButtons}
364370
{cellExpander}
365371
{cellContent}
366-
{tooltip}
367372
</div>
368373
);
369374
}

packages/react-data-grid/src/HeaderCell.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class HeaderCell extends React.Component {
3333

3434
state = { resizing: false };
3535

36+
headerCellRef = (node) => this.headerCell = node;
37+
3638
onDragStart = (e) => {
3739
this.setState({ resizing: true });
3840
// need to set dummy data for FF
@@ -118,7 +120,7 @@ class HeaderCell extends React.Component {
118120
'react-grid-HeaderCell--frozen': isFrozen(column)
119121
}, this.props.className, column.cellClass);
120122
const cell = (
121-
<div className={className} style={this.getStyle()}>
123+
<div ref={this.headerCellRef} className={className} style={this.getStyle()}>
122124
{this.getCell()}
123125
{resizeHandle}
124126
</div>
@@ -129,8 +131,9 @@ class HeaderCell extends React.Component {
129131
return (
130132
<DraggableHeaderCell
131133
column={column}
132-
onHeaderDrop={this.props.onHeaderDrop}>
133-
{cell}
134+
onHeaderDrop={this.props.onHeaderDrop}
135+
>
136+
{cell}
134137
</DraggableHeaderCell>
135138
);
136139
}

themes/react-data-grid-cell.css

+14-14
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
box-shadow: 2px 0 5px -2px rgba(136, 136, 136, .3) !important;
2828
}
2929

30+
/* cell which have tooltips need to have a higher z-index on hover so that the tooltip appears above the other cells*/
31+
.react-grid-Cell.has-tooltip:hover {
32+
z-index: 1;
33+
}
34+
35+
.react-grid-Cell.react-grid-Cell--frozen.has-tooltip:hover {
36+
z-index: 3
37+
}
38+
3039
.react-contextmenu--visible {
3140
z-index: 1000;
3241
}
@@ -82,16 +91,8 @@
8291
padding: 0;
8392
}
8493

85-
.cell-tooltip {
86-
position: relative;
87-
display: inline-block;
88-
}
89-
90-
.cell-tooltip:hover {
91-
z-index: 101;
92-
}
93-
9494
.cell-tooltip .cell-tooltip-text {
95+
white-space: normal;
9596
visibility: hidden;
9697
width: 150px;
9798
background-color: black;
@@ -100,12 +101,11 @@
100101
border-radius: 6px;
101102
padding: 5px 0;
102103
position: absolute;
103-
z-index: 1;
104-
bottom: -150%;
104+
top: 50%;
105+
bottom: initial;
105106
left: 50%;
106-
margin-left: -60px;
107-
/* Fade in tooltip - takes 1 second to go from 0% to 100% opacity */
108-
opacity: 1s;
107+
margin-top: 15px;
108+
margin-left: -75px
109109
}
110110

111111
.cell-tooltip:hover .cell-tooltip-text {

0 commit comments

Comments
 (0)