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

The cursor focus position fails in the macOS system #1200

Open
alindas opened this issue Nov 28, 2024 · 0 comments
Open

The cursor focus position fails in the macOS system #1200

alindas opened this issue Nov 28, 2024 · 0 comments

Comments

@alindas
Copy link

alindas commented Nov 28, 2024

Jodit Version: 4.1.2

Browser: Safary
OS: Mac
Is React App: True
Reproduced on xdsoft.net: False

Description
When the editor loses focus, it is impossible to insert content into the original cursor by calling APIs such as insertHTML and insertImage elsewhere;
Moreover, methods such as editor. s. save() and editor. s. restore() are ineffective, and editor. s. focus cannot be refocused;
Only appears on macOS, not on Windows!

Test like this Code

// editor config
{
        buttons: [
            // When the editor loses focus, click here,It won't take effect, the cursor cannot be added correctly to the editor
            {
                name: 'testFocus',
                tooltip: 'testFocus',
                exec: (e) => {
                    // e === window._MDEditor
                    e.selection.restore() 
                    e.selection.focus()
                },
              },
        ]
        event: {
            blur: () => {
                window._MDEditor.selection.save()
              }
        }
    }

Expected behavior:
The cursor can be correctly restored. Consistent with running on windows.

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

No branches or pull requests

1 participant