Elemental2: KeyboardEvent Issues in Safari

108 views
Skip to first unread message

Harsh Yadav

unread,
Aug 1, 2017, 4:59:40 AM8/1/17
to GWT Contributors
The following code breaks in Safari, as KeyboardEvent.key is not supported in Safari (https://www.w3schools.com/jsref/event_key_key.asp):

inputElement.addEventListener("keypress", inKeyPressEvent -> {
 if (!"Enter".equals(((KeyboardEvent) inKeyPressEvent).key)) {
      handleKeyPress();
 
}
});


The possible alternatives like: 

charCode, keyCode, which
could be used in this case, however they are not exposed via the KeyboardEvent class inside Elemental2

Is there a work-around (other than JSNI as it works correctly)?

Thanks,
Harsh

Goktug Gokdogan

unread,
Aug 1, 2017, 5:06:55 PM8/1/17
to google-web-toolkit-contributors

Being said that pls use gwt-user group for getting support.




--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/da14cf45-97b8-43bd-b826-c34d6101b07f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages