weixin_39927799 2020-11-30 09:01
浏览 0

error if IE10 is in zoom mode

Originally by Florian Geiger

There is a problem within the static method com.vaadin.terminal.gwt.client.MouseEventDetails#deSerialize(String) where the incoming String values are parsed using Integer.parseInt(). If the browser is IE10 and is in a zoom mode other then 100%, a NumberFormat Exception in class com.vaadin.terminal.gwt.client.MouseEventDetails#deSerialize occurs.

The proposed solution could be:


public static MouseEventDetails deSerialize(String serializedString) {
    MouseEventDetails instance = new MouseEventDetails();
    String[] fields = serializedString.split(",");

    instance.button = saveParseInt(fields[0]);
    instance.clientX = saveParseInt(fields[1]);
    instance.clientY = saveParseInt(fields[2]);
    instance.altKey = Boolean.valueOf(fields[3]).booleanValue();
    instance.ctrlKey = Boolean.valueOf(fields[4]).booleanValue();
    instance.metaKey = Boolean.valueOf(fields[5]).booleanValue();
    instance.shiftKey = Boolean.valueOf(fields[6]).booleanValue();
    instance.type = saveParseInt(fields[7]);
    instance.relativeX = saveParseInt(fields[8]);
    instance.relativeY = saveParseInt(fields[9]);
    return instance;
}

private static int saveParseInt(String s) {
    double d = Double.parseDouble(s);
    return (int) d;
} 

Refers to the support request [https://vaadin.com/pro/support-request#216]

Imported from https://dev.vaadin.com/ issue #11641

该提问来源于开源项目:vaadin/framework

  • 写回答

6条回答 默认 最新

  • weixin_39927799 2020-11-30 09:01
    关注

    Originally by -

    The base problem is running IE10 in native mode until #9463 has been fully fixed. A better way to fix this particular problem would be to ensure the sent values are integers on the client side, where the actual problem is.

    评论

报告相同问题?