Skip to content

Commit

Permalink
Merge pull request #3 from Im-Rises/develop
Browse files Browse the repository at this point in the history
Corrected imputs
  • Loading branch information
Im-Rises committed Sep 22, 2023
2 parents f866edb + 021c945 commit b1a610c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function App() {
</div>
<div>
<label htmlFor={'input-particle-mass'}>Particle mass : </label>
<input type={'number'} id={'input-particle-mass'} value={particleMass} min={1} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 1) {
<input type={'number'} id={'input-particle-mass'} value={particleMass} min={0.01} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 0.01) {
setParticleMass(parseInt("1"));
return;
}
Expand All @@ -62,8 +62,8 @@ function App() {
</div>
<div>
<label htmlFor={'input-softening'}>Softening : </label>
<input type={'number'} id={'input-softening'} value={softening} min={1} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 1) {
<input type={'number'} id={'input-softening'} value={softening} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) === 0) {
setSoftening(parseInt("1"));
return;
}
Expand All @@ -82,18 +82,18 @@ function App() {
</div>
<div>
<label htmlFor={'input-theta'}>Theta : </label>
<input type={'number'} id={'input-theta'} value={theta} min={1} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 1) {
setTheta(parseInt("1"));
<input type={'number'} id={'input-theta'} value={theta} min={0} max={1} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 0) {
setTheta(parseInt("0"));
return;
}
setTheta(parseInt(e.target.value))
}}/>
</div>
<div>
<label htmlFor={'input-g'}>G : </label>
<input type={'number'} id={'input-g'} value={G} min={1} onChange={(e) => {
if (e.target.value === '' || parseInt(e.target.value) < 1) {
<input type={'number'} id={'input-g'} value={G} onChange={(e) => {
if (e.target.value === '') {
setG(parseInt("1"));
return;
}
Expand Down

0 comments on commit b1a610c

Please sign in to comment.