mirror of
https://github.com/maputnik/editor.git
synced 2026-11-29 21:34:20 +00:00
Fixed undo button disabled state for expressions.
This commit is contained in:
1 parent
dc6006fd6d
commit
0567b098ec
1 file changed
+3
-2
@@ -20,7 +20,7 @@ export default class ExpressionProperty extends React.Component {
|
||||
error: PropTypes.object,
|
||||
onChange: PropTypes.func,
|
||||
onUndo: PropTypes.func,
|
||||
canUndo: PropTypes.bool,
|
||||
canUndo: PropTypes.func,
|
||||
}
|
||||
|
||||
constructor (props) {
|
||||
@@ -29,6 +29,7 @@ export default class ExpressionProperty extends React.Component {
|
||||
|
||||
render() {
|
||||
const {value, canUndo} = this.props;
|
||||
const undoDisabled = canUndo ? !canUndo() : true;
|
||||
|
||||
const deleteStopBtn = (
|
||||
<>
|
||||
@@ -36,7 +37,7 @@ export default class ExpressionProperty extends React.Component {
|
||||
<Button
|
||||
key="undo_action"
|
||||
onClick={this.props.onUndo}
|
||||
disabled={canUndo ? canUndo() : false}
|
||||
disabled={undoDisabled}
|
||||
className="maputnik-delete-stop"
|
||||
>
|
||||
<MdUndo />
|
||||
|
||||
Reference in new issue
Block a user