Skip to content

Commit

Permalink
Merge pull request #782 from facebookresearch/clear-out-input-box-for…
Browse files Browse the repository at this point in the history
…-nmist

Input hides when annotation is correct for mnist example
  • Loading branch information
Etesam913 authored May 31, 2022
2 parents c27a376 + 2dbadeb commit b268cdb
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

import React from "react";
import React, { Fragment } from "react";
import CanvasDraw from "react-canvas-draw";

function LoadingScreen() {
Expand Down Expand Up @@ -95,15 +95,19 @@ function AnnotationCanvas({ onUpdate, classifyDigit }) {
value={isCorrect !== true}
onChange={() => setIsCorrect(!isCorrect)}
/>
<br />
Corrected Annotation:
<br />
<input
type="text"
disabled={currentAnnotation === null}
value={trueAnnotation}
onChange={(evt) => setTrueAnnotation(evt.target.value)}
/>
{!isCorrect && (
<Fragment>
<br />
Corrected Annotation:
<br />
<input
type="text"
disabled={currentAnnotation === null}
value={trueAnnotation}
onChange={(evt) => setTrueAnnotation(evt.target.value)}
/>
</Fragment>
)}
</div>
);
}
Expand Down

0 comments on commit b268cdb

Please sign in to comment.