Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireFox ctrl+a dont work (CodeJar 3.5.0) #75

Closed
Mainpat opened this issue Jan 21, 2022 · 5 comments · Fixed by #82
Closed

FireFox ctrl+a dont work (CodeJar 3.5.0) #75

Mainpat opened this issue Jan 21, 2022 · 5 comments · Fixed by #82

Comments

@Mainpat
Copy link

Mainpat commented Jan 21, 2022

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 :)

@Mainpat Mainpat changed the title FireFox ctrl+a dont work in CodeJar 3.5.0 FireFox ctrl+a dont work (CodeJar 3.5.0) Jan 21, 2022
@antonmedv
Copy link
Owner

FireFox, mehh. As usual.

Any volunteers to find regression bug between versions?

@Creekmind
Copy link
Contributor

Creekmind commented Jan 26, 2022

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

@antonmedv
Copy link
Owner

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

@zamfofex
Copy link
Contributor

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.

@Creekmind
Copy link
Contributor

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

moderatelyConfused added a commit to moderatelyConfused/codejar that referenced this issue Jul 31, 2022
In cases where the cursor is at the beginning/end of the text or when all of the text is selected, window.getSelection() can specify the selection with respect to the editor instead of specific text nodes.
This change adds support for saving selection state in save() when this is the case.
Fixes antonmedv#75
antonmedv pushed a commit that referenced this issue Jul 31, 2022
)

In cases where the cursor is at the beginning/end of the text or when all of the text is selected, window.getSelection() can specify the selection with respect to the editor instead of specific text nodes.
This change adds support for saving selection state in save() when this is the case.
Fixes #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants