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

How to get native event object in button click event handler? #542

Closed
aztack opened this issue Apr 24, 2023 · 3 comments
Closed

How to get native event object in button click event handler? #542

aztack opened this issue Apr 24, 2023 · 3 comments

Comments

@aztack
Copy link

aztack commented Apr 24, 2023

pane.addButton({title: 'Save'}).on('click', e => {
  // if ctrlKey is pressed
  ?
  // else
 ///
});
@aztack
Copy link
Author

aztack commented Apr 26, 2023

I found the solution:

pane.addButton({title:'Save'}).element.on('click', e => {
 //...
});

@cocopon
Copy link
Owner

cocopon commented Dec 21, 2023

Implemented in #591. You'll be able to access the native event object via e.native from the next version.

pane.addButton({title: 'Save'}).on('click', (ev) => {
  console.log(ev.native);
});

@cocopon
Copy link
Owner

cocopon commented Dec 22, 2023

Released 4.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants