Skip to content

Commit 874a03a

Browse files
Merge pull request #843 from buildo/842-tablo_resizing_plugin_should
#842: Tablo: resizing plugin should be disabled if onColumnsResize is missing (closes #842)
2 parents 7a6c1fd + 9c4b3da commit 874a03a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tablo/plugins/columnsResize/columnsResizeGrid.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ const addSizeProps = ({ col }) => ( //eslint-disable-line
1515

1616
const propsTypes = {
1717
className: maybe(t.String),
18-
onColumnResize: t.Function,
18+
onColumnResize: maybe(t.Function),
1919
children: maybe(t.ReactChildren)
2020
};
2121

22-
const getLocals = ({ className, children, onColumnResize, ...gridProps }) => {
22+
const getLocals = (props) => {
23+
const { className, children, onColumnResize, ...gridProps } = props;
24+
25+
// if `onColumnResize` is missing bypass this plugin
26+
if (!onColumnResize) {
27+
return props;
28+
}
2329

2430
const onColumnResizeEndCallback = (width, key) => {
2531
onColumnResize({ width, key });

0 commit comments

Comments
 (0)