seqviz icon indicating copy to clipboard operation
seqviz copied to clipboard

Keyboard events don't include all properties in onSelection event

Open jpsorensen-asimov opened this issue 1 year ago • 0 comments

Describe the bug

When making a selection via the mouse, onSelection is called with a selection object like the following:

{
    "clockwise": true,
    "end": 16,
    "length": 7,
    "name": "",
    "ref": null,
    "start": 9,
    "type": "SEQ"
}

However, when making the same selection using the keyboard (setting the cursor at the start position and then shift+arrow to get to the end), we get an object like the following:

{
    "clockwise": true,
    "end": 16,
    "start": 9,
    "type": "SEQ"
}

Although most of the missing values (name, ref) are nonsense / empty values, length is an actual value that's present on mouse events but not keyboard events.

length is an optional field, so in some sense this isn't a bug (a client should be prepared to handle an empty length) but I suspect this is accidental and not intentional - is that correct?

Thanks!

Expected behavior

Same / similar selection object regardless of whether the selection was performed via mouse or keyboard.

Screenshots

Your environment:

  • OS: OS: Mac OS 15.1.1 (24B91)
  • Browser Chrome

jpsorensen-asimov avatar Jan 09 '25 15:01 jpsorensen-asimov