Open
Description
Subject of the issue
.trigger("focus")
doesn't work anymore for contenteditable
elements.
It works only on input
elements.
It is working on 1.1.3. I think PR1777 introduced this regression
Steps to reproduce
Test:
wrapper.find(".input-field").trigger("focus")
expect(wrapper.emitted("focus")).toBeTruthy()
Component:
<div class="input-field" contenteditable @focus="onFocus" />
...
onFocus() {
this.$emit("focus")
}
Expected behaviour
Event should be triggered
Actual behaviour
Event is not triggered
Possible Solution
This is workaround:
wrapper.find(".input-field").element.dispatchEvent(new Event("focus"))
.
But I guess .trigger("focus")
is also expected to work for contenteditable