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

addAtom only works when editor is focused #121

Open
benkingcode opened this issue Dec 16, 2016 · 2 comments
Open

addAtom only works when editor is focused #121

benkingcode opened this issue Dec 16, 2016 · 2 comments

Comments

@benkingcode
Copy link

I have some buttons in my editor toolbar that add an atom to the editor. Here's the code:

<button class="btn tag tag-info" {{action editor.addAtom 'message-tag' 'example'}}>example</button>

However, the button only works when the editor is actively focused. If the user presses a button while the editor is not focused, nothing happens. The ideal behaviour would be appending the atom to the end of the document.

@JimSchofield
Copy link

I've run into this issue as well... 5 years later, is there any solution to this yet?

@JimSchofield
Copy link

JimSchofield commented Jul 7, 2021

I see the comment from bustle/mobiledoc-kit#405 and I am able to find a solution by storing the last focusedCursor position and reapplying the cursor position before the atom is added. I hope that helps for anyone else who encounters this issue :)

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

2 participants