codejar icon indicating copy to clipboard operation
codejar copied to clipboard

Undo / redo not working

Open eyssette opened this issue 2 years ago • 8 comments

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

eyssette avatar May 08 '22 12:05 eyssette

It seems working for me. What is your setup?

antonmedv avatar May 08 '22 13:05 antonmedv

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/.

eyssette avatar May 08 '22 16:05 eyssette

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

antonmedv avatar May 08 '22 16:05 antonmedv

I'm using a French keyboard.

eyssette avatar May 08 '22 16:05 eyssette

Probably this is a reason.

antonmedv avatar May 08 '22 16:05 antonmedv

Same problem in a previous version of your app with a solution : https://github.com/antonmedv/codejar/pull/37 But not working for other keyboards : https://github.com/antonmedv/codejar/pull/58

eyssette avatar May 08 '22 16:05 eyssette

Maybe using keyCode would be better (event if it's supposed to be deprecated). Same comment here : https://github.com/antonmedv/codejar/issues/73

eyssette avatar May 08 '22 16:05 eyssette

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.

ShiriCZ avatar Aug 19 '22 09:08 ShiriCZ

redo & undo still not working (German Keyboard)

julianpoemp avatar Sep 26 '22 20:09 julianpoemp

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

julianpoemp avatar Jan 07 '23 14:01 julianpoemp

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

julianpoemp avatar Feb 12 '23 13:02 julianpoemp

Will try to release it today.

antonmedv avatar Feb 12 '23 17:02 antonmedv

+1 would love to see the PR be merged

simcolin avatar Feb 15 '23 09:02 simcolin

Released 3.7.0)

antonmedv avatar Feb 27 '23 21:02 antonmedv