Reputation: 11
I am adding plus / minus icon buttons to the CKEditor image properties preview for a user to click on them and increase / decrease the image width and height by a fixed number of pixels without having to type in the values.
I see that the keyup event updates the image preview as well as the lock ratio. How to correctly simulate the required keyup event in JavaScript / jQuery after the new pixel value has been set in the width / height input fields?
Upvotes: 0
Views: 152
Reputation: 11
Something like the following works:
my_input.dispatchEvent(new KeyboardEvent('keyup', {
'key': '1'
}));
Upvotes: 0