Editor.getSelected() giving me undefined.
See original GitHub issueHi @artf I want to append dynamic pages to the specific link trait.
Here is what i am using.
const component = editor.getSelected(); component.getTrait('link').set('options', [ { value: 'opt1', name: 'New option 1'}, { value: 'opt2', name: 'New option 2'}, ]);
This is giving component is undefined in the console because by default not any element is selected
Could you please guide me on this . I want to append that pages in list of link trait whenever i click on the link
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
In CKEditor getSelection() returns null value in IE
So i checked the code and found that getSelection() having an null value. Please help me how to solve it. I tried some...
Read more >Uncaught TypeError: Cannot use 'in' operator to search for ' ...
Hi, I am seeing error with Kendo Editor : Uncaught TypeError: Cannot use 'in' operator to search for 'getSelection' in undefined.
Read more >7561 (IE 'editor.getSelection()' is null or not an object)
According to the documentation, and my observations, editor.getSelection() can return null. This statement should be wrapped in a conditional block to avoid ...
Read more >Unable to get property 'createrange' of undefined or null ...
var range = editor.get_document().getSelection().createRange(); but unfortunatly it is not working. JavaScript.
Read more >Unable to get property 'createRange' of undefined or null ...
selection, but with IE11 it changed to Document.getSelection(). That's the bad news. The good news is that form.js gets this docEditor by ...
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 Free
Top 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
Thank you so much @Ju99ernaut Now,It working perfectly. Really appreciate your help. Closing this issue.
You can check if
component.getTrait('href')
gets anything first: