From 834a4c156423277052b77d7bebc216a47e966f3b Mon Sep 17 00:00:00 2001 From: Dario Del Piano Date: Tue, 9 Jul 2024 11:50:21 +0200 Subject: [PATCH] fixing coordinate range that cannot be deleted --- webapp/components/general/NetPyNECoordsRange.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/components/general/NetPyNECoordsRange.js b/webapp/components/general/NetPyNECoordsRange.js index 0d35b5f9..65571187 100644 --- a/webapp/components/general/NetPyNECoordsRange.js +++ b/webapp/components/general/NetPyNECoordsRange.js @@ -127,7 +127,7 @@ export default class NetPyNECoordsRange extends Component { this.setState({ rangeType}) } - //preConds: pop, cellType, cellModel, x, y, z, xnorm, ynorm, znorm + // preConds: pop, cellType, cellModel, x, y, z, xnorm, ynorm, znorm handleCoordParamChange(index, newValue) { const { model, @@ -135,6 +135,9 @@ export default class NetPyNECoordsRange extends Component { name, } = this.props; + if (Object.is(newValue, NaN)) { + newValue = 0; + } if (newValue === '' || (/^\d+$/.test(newValue))) { if (this.state.rangeType && this.state.rangeType.length > 0)