antonmedv/codejar

FireFox ctrl+a dont work (CodeJar 3.5.0)

Mainpat opened this issue · 5 comments

Hey, we using Angular 12 with CodeJar 3.5.0 and have problems with FireFox and CTRL+A.

When you try to mark all text with CTRL+A and e.g. copy it with CTRL+C in FireFox it's don't working.

after CTRL+A the text is selected, but when you press CTRL again the text is deselected or somtimes only the last part.
When you use the mouse for select all the text or the shift+arrow keys and press CTRL works fine. Chrome has no problems with this. I have try it in CodeJar 3.4.0 with FireFox and there you also have no problems with CTRL+A, my current workaround is downgrade to CodeJar 3.4.0

I hope you can find and fix it, so we can stay up to date with the newest version of CodeJar :)

FireFox, mehh. As usual.

Any volunteers to find regression bug between versions?

Hi!

Issue with restore(save()) inside keydown listener. It was added in PR: #49 .
But I don't get it why it is there, because everything seems working without this line. I am missing something

@zamfofex need help :)

...
if (isLegacy) restore(save()) // Legacy is false for chrome
...

It will really awesome if we can add tests in GitHub action with real firefox and chrome.

From the PR description:

Work around seemingly buggy selection behavior in Firefox when nodes are swapped around. It seems Firefox doesn’t like when nodes containing the selection are replaced entirely while the user is manipulating the selection, and it will reposition the selection in weird ways immediately before the keyup event is dispatched. Modifying the selection seems to suppress this behavior, so it suffices to write restore(save()) during the keydown event dispatch.

It is not impossible (and is actually very likely) that Firefox simply resolved that “seemingly buggy behavior” since that time.

@zamfofex Yes, I read it. Do you have project/jsfiddle, where I can reproduce it?