Skip to content

Commit 4c4ed15

Browse files
authored
fix(react-grid-bootstrap3): repair column chooser positioning (#740)
1 parent 1cc6ae4 commit 4c4ed15

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

packages/dx-react-grid-bootstrap3/src/templates/column-chooser/overlay.jsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
import * as React from 'react';
22
import * as PropTypes from 'prop-types';
33
import { Overlay as OverlayBS3 } from 'react-bootstrap';
4-
5-
const Popover = ({ children }) => (
6-
<div
7-
className="dropdown-menu"
8-
style={{
9-
padding: 0,
10-
display: 'block',
11-
border: 'none',
12-
}}
13-
>
14-
{children}
15-
</div>
16-
);
17-
18-
Popover.propTypes = {
19-
children: PropTypes.node.isRequired,
20-
};
4+
import { Popover } from './popover';
215

226
export const Overlay = ({
237
visible, target,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as React from 'react';
2+
import * as PropTypes from 'prop-types';
3+
4+
export const Popover = ({ children, style }) => (
5+
<div
6+
className="dropdown-menu"
7+
style={{
8+
padding: 0,
9+
display: 'block',
10+
border: 'none',
11+
...style,
12+
}}
13+
>
14+
{children}
15+
</div>
16+
);
17+
18+
Popover.propTypes = {
19+
children: PropTypes.node.isRequired,
20+
style: PropTypes.object,
21+
};
22+
23+
Popover.defaultProps = {
24+
style: null,
25+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from 'react';
2+
import { shallow } from 'enzyme';
3+
import { Popover } from './popover';
4+
5+
describe('Popover', () => {
6+
it('should pass styles to the root element', () => {
7+
const tree = shallow((
8+
<Popover
9+
style={{ left: 100, top: 50 }}
10+
>
11+
<div />
12+
</Popover>
13+
));
14+
15+
expect(tree.prop('style'))
16+
.toMatchObject({ left: 100, top: 50 });
17+
});
18+
});

0 commit comments

Comments
 (0)