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

Prevent JS exception in Toast's global event handler in case of missing key #8125

Closed
tzimmermann opened this issue Jan 17, 2024 · 1 comment · Fixed by #8209
Closed

Prevent JS exception in Toast's global event handler in case of missing key #8125

tzimmermann opened this issue Jan 17, 2024 · 1 comment · Fixed by #8209
Assignees
Labels
bug This issue is a bug in the code Low Prio SAP Signavio SAP Signavio TOPIC RL

Comments

@tzimmermann
Copy link

Since we've upgraded our app from @ui5/webcomponents@1.16.0 to 1.20.0, we've been getting some errors logged in our sentry that look like this:
image

We are not able to reproduce it yet, but the current assumption is that some browser quirk (like this one) or some auto-fill feature generates KeyboardEvents with undefined as key sometimes.

Thus, it would be nice to add some optional chaining for the key field here, in order to prevent logging noise.
Especially since this is a global event handler (we are not even using any Toast component in our app) that gets called a lot.

const isMKey = e.key.toLowerCase() === "m";

@niyap
Copy link
Contributor

niyap commented Jan 17, 2024

Hello @SAP/ui5-webcomponents-topic-rl,

Please check the handleGlobalKeydown method of ui5-toast web component. On android mobile device, there are cases when e.key returns undefined so e.key.toLowerCase() throws an error.

Could you please and enhance the condition?

Thank you in advance!

Kind Regards,
Niya

@niyap niyap self-assigned this Jan 17, 2024
@niyap niyap added bug This issue is a bug in the code Low Prio TOPIC RL labels Jan 17, 2024
@niyap niyap added this to New Issues in Maintenance - Topic RD via automation Jan 17, 2024
@niyap niyap removed this from New Issues in Maintenance - Topic RD Jan 17, 2024
@niyap niyap added this to New Issues in Maintenance - Topic RL via automation Jan 17, 2024
@petyabegovska petyabegovska added the SAP Signavio SAP Signavio label Jan 18, 2024
@niyap niyap moved this from New Issues to In progress in Maintenance - Topic RL Jan 31, 2024
Maintenance - Topic RL automation moved this from In progress to Completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug in the code Low Prio SAP Signavio SAP Signavio TOPIC RL
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants