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

interactive ui5-icon: two click events fired for one click action #2857

Closed
BennyHuang opened this issue Feb 22, 2021 · 1 comment · Fixed by #2858
Closed

interactive ui5-icon: two click events fired for one click action #2857

BennyHuang opened this issue Feb 22, 2021 · 1 comment · Fixed by #2858

Comments

@BennyHuang
Copy link

Describe the bug
interactive ui5-icon fires two 'click' event on one click action. One is fired with CustomEvent and another one is fired with native MouseEvent (bubbled from internal svg).

To reproduce
Steps to reproduce the behavior:
The event hander is attached in either
<ui5-icon onClick={handler}></ui5-icon>
or
icondom.addEventListener('click', handler)

Upon clicking on the icon, the handler is executed twice. If focusing and entering Space, the handler is executed only once with the CustomEvent.

If the event handler is attached to noConflict event, the handler is executed only once as expected.
icondom.addEventListener('ui5-click', handler)

Expected behavior
ui5-icon should fire click event once with CustomEvent upon clicking on the icon.

Context
UI5 Web Components version: 0.29.1

Affected components (if known)
ui5-icon

@ilhan007
Copy link
Member

Hello @BennyHuang thanks for reporting this issue. A fix is prepared: #2858

ilhan007 added a commit that referenced this issue Feb 23, 2021
We used to fire a custom event, but did not stop the native one and end up with firing two "click" events.
Now, the native one is stopped properly (we need to fire the custom one, so the noConflict ui5-click is also fired). Also, one additional fix has been performed - the content no longer scrolls when the SPACE key is pressed over "interactive" icon.

FIXES: #2857
ilhan007 added a commit that referenced this issue Feb 23, 2021
We used to fire a custom event, but did not stop the native one and end up with firing two "click" events.
Now, the native one is stopped properly (we need to fire the custom one, so the noConflict ui5-click is also fired). Also, one additional fix has been performed - the content no longer scrolls when the SPACE key is pressed over "interactive" icon.

FIXES: #2857
ilhan007 added a commit that referenced this issue Feb 25, 2021
We used to fire a custom event, but did not stop the native one and end up with firing two "click" events.
Now, the native one is stopped properly (we need to fire the custom one, so the noConflict ui5-click is also fired). Also, one additional fix has been performed - the content no longer scrolls when the SPACE key is pressed over "interactive" icon.

FIXES: #2857
@petyabegovska petyabegovska moved this to Completed in Maintenance - Topic P Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

2 participants