question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyBoardEvents cause error on serverside with IE Edge

See original GitHub issue

KeyBoardEvent requires a “isComposing” property and Edge doesn’t give such so using standard keyboard events (KeyDownEvent, KeyPressEvent, KeyUpEvent) will cause exception on creation of given event:

java.lang.IllegalArgumentException: Unable to create an event object of type com.vaadin.flow.component.KeyUpEvent
	at com.vaadin.flow.component.ComponentEventBus.createEventForDomEvent(ComponentEventBus.java:362)

Test:

Input input = new Input();
input.addListener(KeyUpEvent.class, keyUpEvent -> {
	// throws java.lang.IllegalArgumentException: 
	// with Edge
	if (keyUpEvent.getKey().equals(Key.ENTER)) {
		System.out.println("We got enter!");
	}
});

The data that actually comes from client to server:

image

In the end this is (isComposing) only a boolean value so probably it could just fall back to false in this (or other similar) cases.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, May 14, 2018

I think for missing boolean properties we could just set the default to false if it is missing from the json received. I would find this much better DX than the error.

0reactions
Legiothcommented, May 17, 2018

Concluded that instead of allowing to explicitly configure default values, we should simplify this by explicitly checking for primitive @EventData parameters and in that case convert a missing or null value to the corresponding default value (i.e. false, 0 or 0.0 for the three types that are currently supported). These are also the values that you get with asBoolean() or asNumber() from a JsonNull value.

If the developer wants to distinguish between e.g. false and a missing value, then they can change the parameter type from boolean to Boolean and handle a null value in their own code instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Script errors in Internet Explorer - Browsers - Microsoft Learn
A script error occurs in Internet Explorer, the webpage cannot be displayed correctly and you receive an error message.
Read more >
Common Microsoft Edge Problems, and How to Fix Them
The error message should have an option to either pop open Internet Explorer or continue with Edge and face potential loading issues.
Read more >
Fix: Can't Type into Text Fields on Some Browsers - Appuals
Fix: Can't Type into Text Fields on Some Browsers · What is causing the 'Can't Type in Any Browser Text Field' issue? ·...
Read more >
Debug JavaScript in Internet Explorer 11 in 7 easy steps
Need to debug JavaScript in Internet Explorer? Simply follow these 7 steps. Includes examples. Read our debugging guide today.
Read more >
[Solved] “Side by Side Configuration Is Incorrect” Error on ...
A common cause for this error is a conflict between the C++ run-time libraries and the application you're trying to open or install....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found