antonmedv/codejar

Undo / redo not working

eyssette opened this issue ยท 14 comments

Your app is really great! Unfortunately, undo / redo seems to be broken.
Is there any way to make it work?
Thank you!

It seems working for me. What is your setup?

I'm using Codejar for a mindmap app https://mymarkmap.vercel.app/. Undo/redo doesn't work on Mac OS (Monterey 12.2.1) or Lubuntu (20.04), whatever browser I try to use.

It's the same for the examples on your website https://medv.io/codejar/.

Works for me on macOS via Chrome. Also I use USA keyboard.

I'm using a French keyboard.

Probably this is a reason.

Same problem in a previous version of your app with a solution : #37
But not working for other keyboards : #58

Maybe using keyCode would be better (event if it's supposed to be deprecated). Same comment here : #73

I have the same problem. I'm using Czech keyboard layout. The fix is simple just rewrite lines 453 and 457 (codejar.ts) in isUndo/isRedo function from
event.code === 'KeyZ';
to
event.keyCode == 90;
Then it should work on every keyboard layout, because KeyCode is universal.

redo & undo still not working (German Keyboard)

@antonmedv I just created a PR that solves this issue for everyone who uses other keyboard layouts than QUERTY. Can you please merge it?

because this issue is still not fixed I created a repository with a build from my fix. You can install it via

npm install --save julianpoemp/codejar-fixed-redo-undo --legacy-peer-deps

Repository: https://github.com/julianpoemp/codejar-fixed-redo-undo

Will try to release it today.

+1 would love to see the PR be merged

Released 3.7.0)