medium-editor icon indicating copy to clipboard operation
medium-editor copied to clipboard

Exception when calling checkContentChanged on editor which is not in focus

Open laacz opened this issue 6 years ago • 4 comments

Description

When clicking button, its event handler calls editor.checkContentChanged(). Error is thrown.

Uncaught TypeError: target.getAttribute is not a function
    at Events.updateInput (medium-editor.js:2921)
    at MediumEditor.checkContentChanged (medium-editor.js:7771)
    at HTMLButtonElement.<anonymous> (pen.js:3)

Steps to reproduce

  1. Trigger checkContentChanged when target editor is not focused.

Expected behavior: Trigger update check

Actual behavior: Exception is being thrown

Link to an example: https://codepen.io/laacz/pen/JxmjZG

Versions

  • medium-editor: 5.23.3
  • browser: Chrome win 71.0.3578.98
  • OS: Windows 10

laacz avatar Feb 14 '19 20:02 laacz

Hi @laacz! Did you find a fix for this issue?

micromagicman avatar Mar 15 '19 18:03 micromagicman

@Micromagicman, I worked around with not using checkContentChanged.

laacz avatar Mar 15 '19 19:03 laacz

Hi @laacz , could you please share more details on your workaround?

lucaprevitali avatar Feb 08 '24 10:02 lucaprevitali

@lucaprevitali Negative. It was so long ago that I really don't remember anymore.

laacz avatar Feb 08 '24 13:02 laacz