KeyBoardEvents cause error on serverside with IE Edge
See original GitHub issueKeyBoardEvent 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:
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:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think for missing
boolean
properties we could just set the default tofalse
if it is missing from the json received. I would find this much better DX than the error.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
or0.0
for the three types that are currently supported). These are also the values that you get withasBoolean()
orasNumber()
from aJsonNull
value.If the developer wants to distinguish between e.g.
false
and a missing value, then they can change the parameter type fromboolean
toBoolean
and handle anull
value in their own code instead.