Howdy! I'm trying to simulate an ENTER keyup event using PhantomJS, but running into an exception:
simulateEvent.simulate(el, 'keyup', { keyCode: 13 })
// => TypeError: Attempting to change value of a readonly property.
The keyCode property is read-only (as per the spec), and when Object.defineProperty gets called with the specified override, the above exception is thrown.
I'd be happy to submit a PR, but I'm not quite sure if the fix is preferable here or here. It seems to me that we basically need to fall back to specifying all the overrides directly at construction time, but I'm not familiar enough with the event construction to know whether that belongs further up or further down.
Howdy! I'm trying to simulate an ENTER keyup event using PhantomJS, but running into an exception:
The
keyCodeproperty is read-only (as per the spec), and whenObject.definePropertygets called with the specified override, the above exception is thrown.I'd be happy to submit a PR, but I'm not quite sure if the fix is preferable here or here. It seems to me that we basically need to fall back to specifying all the overrides directly at construction time, but I'm not familiar enough with the event construction to know whether that belongs further up or further down.