Skip to content

Commit d74ecb6

Browse files
authored
Merge pull request #949 from react-bootstrap-table/develop
20190519 release
2 parents 1e164bb + 2c6cc91 commit d74ecb6

File tree

9 files changed

+330
-177
lines changed

9 files changed

+330
-177
lines changed

packages/react-bootstrap-table2-overlay/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export default options => loading =>
1111
componentDidMount() {
1212
if (loading) {
1313
const { wrapper } = this.overlay;
14-
const masker = wrapper.firstChild;
15-
const headerDOM = wrapper.parentElement.querySelector('thead');
16-
const bodyDOM = wrapper.parentElement.querySelector('tbody');
17-
const captionDOM = wrapper.parentElement.querySelector('caption');
14+
const masker = wrapper.current.firstChild;
15+
const headerDOM = wrapper.current.parentElement.querySelector('thead');
16+
const bodyDOM = wrapper.current.parentElement.querySelector('tbody');
17+
const captionDOM = wrapper.current.parentElement.querySelector('caption');
1818

1919
let marginTop = window.getComputedStyle(headerDOM).height;
2020
if (captionDOM) {

packages/react-bootstrap-table2-overlay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
}
3838
],
3939
"dependencies": {
40-
"react-loading-overlay": "0.2.8"
40+
"react-loading-overlay": "1.0.1"
4141
},
4242
"peerDependencies": {
4343
"prop-types": "^15.0.0",

packages/react-bootstrap-table2-overlay/yarn.lock

Lines changed: 310 additions & 158 deletions
Large diffs are not rendered by default.

packages/react-bootstrap-table2-toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@
4545
"react-dom": "^16.3.0"
4646
},
4747
"dependencies": {
48-
"file-saver": "1.3.8"
48+
"file-saver": "2.0.2"
4949
}
5050
}

packages/react-bootstrap-table2-toolkit/src/search/SearchBar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class SearchBar extends React.Component {
6969
id={ `search-bar-${tableId}` }
7070
type="text"
7171
style={ style }
72+
aria-label="enter text you want to search"
7273
onKeyUp={ () => this.onKeyup() }
7374
onChange={ this.onChangeValue }
7475
className={ `form-control ${className}` }

packages/react-bootstrap-table2-toolkit/yarn.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# yarn lockfile v1
33

44

5-
file-saver@1.3.8:
6-
version "1.3.8"
7-
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-1.3.8.tgz#e68a30c7cb044e2fb362b428469feb291c2e09d8"
5+
file-saver@2.0.2:
6+
version "2.0.2"
7+
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.2.tgz#06d6e728a9ea2df2cce2f8d9e84dfcdc338ec17a"
8+
integrity sha512-Wz3c3XQ5xroCxd1G8b7yL0Ehkf0TC9oYC6buPFkNnU9EnaPlifeAFCyCh+iewXTyFRcg0a6j3J7FmJsIhlhBdw==

packages/react-bootstrap-table2/src/header-cell.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ const HeaderCell = (props) => {
4040

4141
const cellAttrs = {
4242
..._.isFunction(headerAttrs) ? headerAttrs(column, index) : headerAttrs,
43-
...headerEvents
43+
...headerEvents,
44+
tabIndex: index + 1
4445
};
4546

4647
let sortSymbol;

packages/react-bootstrap-table2/src/row-selection/selection-cell.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ export default class SelectionCell extends Component {
4343
selected,
4444
onRowSelect,
4545
disabled,
46-
rowIndex,
47-
clickToSelect
46+
rowIndex
4847
} = this.props;
49-
48+
e.stopPropagation();
5049
if (disabled) return;
51-
if (clickToSelect) return;
5250

5351
const checked = inputType === Const.ROW_SELECT_SINGLE
5452
? true

packages/react-bootstrap-table2/test/row-selection/selection-cell.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('<SelectionCell />', () => {
147147
/>,
148148
{ bootstrap4: false }
149149
);
150-
wrapper.find('td').simulate('click');
150+
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
151151
});
152152

153153
it('should calling handleRowClicked', () => {
@@ -173,7 +173,7 @@ describe('<SelectionCell />', () => {
173173
/>,
174174
{ bootstrap4: false }
175175
);
176-
wrapper.find('td').simulate('click');
176+
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
177177
});
178178

179179
it('should calling handleRowClicked', () => {
@@ -201,7 +201,7 @@ describe('<SelectionCell />', () => {
201201

202202
it('should be called with correct paramters', () => {
203203
// first click
204-
wrapper.find('td').simulate('click');
204+
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
205205
expect(mockOnRowSelect.callCount).toBe(1);
206206
expect(mockOnRowSelect.calledWith(rowKey, true, rowIndex)).toBe(true);
207207
});
@@ -223,9 +223,9 @@ describe('<SelectionCell />', () => {
223223

224224
it('should be called with correct parameters', () => {
225225
// first click
226-
wrapper.find('td').simulate('click');
226+
wrapper.find('td').simulate('click', { stopPropagation: jest.fn() });
227227
expect(mockOnRowSelect.callCount).toBe(1);
228-
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex, undefined)).toBe(true);
228+
expect(mockOnRowSelect.calledWith(rowKey, false, rowIndex)).toBe(true);
229229
});
230230
});
231231
});

0 commit comments

Comments
 (0)