Opened 8 years ago
Last modified 8 years ago
#16738 closed Bug
Edge issue: script error on editor.applyStyle() "Unable to get property 'compare' of undefined or null reference" — at Initial Version
Reported by: | zoarif | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.6.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- I have custom style link in my editor that I try to apply using editor.applyStyle(style)and my style is:
const linkStyle: CKEDITOR.style = new CKEDITOR.style({
name: 'link', element: 'a', type: CKEDITOR.STYLE_INLINE, attributes: {'href': data, 'target': '_blank'}
});
- In edge, when I call this method, an exception gets thrown
"Unable to get property 'compare' of undefined or null reference"
- I see that its coming from checkSelectionChange() method:
...
at this line var currentPath = this.elementPath();
if ( !currentPath.compare( this._.selectionPreviousPath ) ) {
...
currentPath is undefined here, it tries to call compare and an exception gets thrown.
Expected result
Style should get applied.
Actual result
Error gets thrown 'Unable to get property 'compare' of undefined or null reference'
Other details (browser, OS, CKEditor version, installed plugins)
This bug is specific to Microsoft Edge 38.14393.0.0. Does not repro in IE and chrome.