How to programatically trigger Enter key in editor in v5?
See original GitHub issueHi,
I was able to programtically insert Enter in v4 like this:
editor.fire('keydown', {keyCode: 13});
This works as well in v5, but Typescript throws:
What is the correct way to trigger Enter key in v5? Should I list all ~40 properties? Wouldn’t @ts-ignore
cause some errors on listeners of this event?
I’ve consulted docs, but it just refers to MDN which provides examples on listening of keydown
, not dispatching. I don’t know if it is rather issue of tinymce or event dispatching generally.
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Trigger a "ENTER" in programmatically - Stack Overflow
Just replace the keydown event with keypress event. ... It should have value Enter when the enter key is to be simulated.
Read more >Fire click event on Enter key - Suite 5.0 - DHTMLX Forum
I am trying to fire Onclick event when the “enter” key is pressed in password textbox. code: myForm.getInput(“txtPassword”).onkeyup = function ( ...
Read more >How to Handle Enter Key Navigation for Tab index - Syncfusion
I have an EditForm which contain 10 textbox and 5 combobox control.I would like to know how to Handle Enter Key Navigation for...
Read more >Animation transitions and triggers - Angular
Use the void state to configure transitions for an element that is entering or leaving a page. See Animating entering and leaving a...
Read more >KeyboardEvent.key - Web APIs | MDN
When key 2 is pressed, another keydown event is fired for this new key press, and the key property value for the event...
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
@dav-sap I’ve sticked with
editor.fire('keydown', {keyCode: 13})
and that works. In your case I suspect rather something different. Have you tried toconsole.log('something')
before theeditor.fire()
to see if it actually make its way to there? Or try to debug with debugger in devtools.thanks anyway 😃 @dakur