Skip to content

Keyboard events don't include all properties in onSelection event #280

@jpsorensen-asimov

Description

@jpsorensen-asimov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions