Skip to content

Commit

Permalink
#6235 fix map sync button popup position (#6236)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz authored Nov 25, 2020
1 parent 6804537 commit ac91678
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/client/components/data/featuregrid/toolbars/TButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import React, { forwardRef } from 'react';

import { Button, Glyphicon } from 'react-bootstrap';

const hideStyle = {
Expand All @@ -15,15 +16,14 @@ const hideStyle = {
};
const normalStyle = {};
const getStyle = (visible) => visible ? normalStyle : hideStyle;

export const SimpleTButton = ({disabled, id, visible, onClick, glyph, active, className = "square-button", ...props}) => {
return (<Button {...props} bsStyle={active ? "success" : "primary"} disabled={disabled} id={`fg-${id}`}
export const SimpleTButton = forwardRef(({ disabled, id, visible, onClick, glyph, active, className = "square-button", ...props }, ref) => {
return (<Button ref={ref} {...props} bsStyle={active ? "success" : "primary"} disabled={disabled} id={`fg-${id}`}
style={getStyle(visible)}
className={className}
onClick={() => !disabled && onClick()}>
<Glyphicon glyph={glyph}/>
<Glyphicon glyph={glyph} />
</Button>);
};
});


export default SimpleTButton;

0 comments on commit ac91678

Please sign in to comment.