Can't type() into contenteditable element. #26525
|
Context: I'm using cypress 10.11.0 and am trying to select an element on ck editor 5. I have a div that has the contenteditable attributes and am trying to type into it, but at run time the type fails and the error suggest that the div doesn't have the attribute, but even right before the type() call it still had it. Doesn't seem to be a problem with CK Editor since it's just html at this point. Code: PS : I've seen this issue but I don't think it's quite the same |
Replies: 2 comments
|
Bump |
|
Common fix: |

.type()supports contenteditable, but you must target the element that actually has the contenteditable attribute (not a child node), and it must be focusable.Common fix:
cy.get(sel).click().type('text')Rich-text editors (Quill/Draft/ProseMirror) often manage their own selection. For those, click to place the cursor first, or dispatch input via the editor’s API.