Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.trigger(:input) doesn't dispatch an input event #197

Open
janko opened this issue May 19, 2022 · 1 comment
Open

node.trigger(:input) doesn't dispatch an input event #197

janko opened this issue May 19, 2022 · 1 comment

Comments

@janko
Copy link

janko commented May 19, 2022

From following the JavaScript code, I believe that node.trigger(:input) currently ends up calling this.dispatchEvent('input'). However, that isn't the correct way to dispatch this event, it should be this.dispatchEvent(new Event('input')).

That's presumably the reason why the Cuprite JavaScript class defines a special input() function, instead of calling trigger().

input(node) {
let event = document.createEvent("HTMLEvents");
event.initEvent("input", true, false);
node.dispatchEvent(event);
}

@jcoyne
Copy link

jcoyne commented Aug 18, 2022

Additionally, shouldn't this event have a property like: { inputType:"insertText" }?

jcoyne referenced this issue in sul-dlss/happy-heron Aug 18, 2022
jcoyne referenced this issue in sul-dlss/happy-heron Aug 18, 2022
peetucket referenced this issue in sul-dlss/happy-heron Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants