File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ interface iProps {
27
27
ReadOnly ?: boolean ;
28
28
HideUpload ?: boolean ;
29
29
HideClear ?: boolean ;
30
+ //HideUndo?: boolean;
30
31
HideColorPicker ?: boolean ;
31
32
disabled ?: boolean ;
32
33
/** true - will prompt user for his name, string will just sign as that string */
@@ -98,7 +99,7 @@ export const DrawPad: React.FunctionComponent<iProps> = (props) => {
98
99
//because this is used in an addEventListener - need to have a ref to get the most up to date onChange
99
100
if ( onChangeRef . current ) {
100
101
let canvasValue = manager . toPng ( ) ;
101
- setcanUndo ( true ) ; //todo - enable undo last??
102
+ setcanUndo ( true ) ;
102
103
onChangeRef . current ( canvasValue ) ;
103
104
}
104
105
} ) ;
@@ -265,6 +266,11 @@ export const DrawPad: React.FunctionComponent<iProps> = (props) => {
265
266
disabled = { props . disabled } buttonOnly value = { props . LineColor } onChange = { newColor => {
266
267
setLineColor ( newColor ) ;
267
268
} } /> }
269
+ { /* todo: undo isn't working properly
270
+ {props.HideUndo || <ButtonEX disabled={!canUndo} title="Undo" icon={<ArrowUndoRegular />} onClick={() => {
271
+ manager.undoLast();
272
+ setcanUndo(manager.canUndo());
273
+ }} /> } */ }
268
274
{ props . HideClear || < ButtonEX disabled = { props . disabled || isNullOrEmptyString ( props . Value ) } title = "Clear" icon = { < DismissRegular /> } onClick = { ( ) => {
269
275
//can call clear on the canvas, or can call the onchange which will cause a re-draw
270
276
setSigned ( false ) ;
You can’t perform that action at this time.
0 commit comments