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