Forcing focus breaks plugins
See original GitHub issueI’ve noticed that when i call focus()
on the Editor, the emoji and mention plugins do not work – that is, they do not respond to :
or @
and suggestions do not populate. I’m guessing focus()
is somehow messing with the selectionState…any ideas on this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:20
- Comments:21
Top Results From Across the Web
Improve your focus by taking more breaks every day
Taking breaks during the day can help you focus and get more done, not to mention it's good for your brain. Use these...
Read more >Multi-step form CSS broken by focus() - WordPress.org
It appears to be because the autofocus (cursor) that loads in the “First Name” textbox is being taken as the relative position of...
Read more >The 8 best apps to help you focus and block distractions in 2023
With that, here's the focusing software I think works best. Best focus app for blocking distractions on all your devices at once. Freedom...
Read more >3 Ways to Force Yourself to Focus | The Muse
1. Strict Workflow. This Chrome plugin is a simple way to try out the Pomodoro technique—a proven method that has you take five-minute...
Read more >Managing Focus | Draft.js
With that in mind, at Facebook we often choose to expose focus() methods on components that wrap text inputs. This breaks the declarative ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to find a temporary solution to this problem by using
setTimeout
on the call tofocus
:setTimeout(this.editor.focus, 50)
Strangely enough, this seems to solve the problem even if you set the timeout value to 0.
My original guess on why this works was that there is still something in the mention suggestions that is still in the process of mounting or rendering, but the parent component’s
componentDidMount
should’t be called until after all this is complete…so really not sure.I just spent about 2 hours to figure out why my
mention
andlinkify
plugin weren’t working. That was so frustrating.We should give more attention to this issue.