Skip to content

Wrong scroll bar position for small lists (16 elements) #10

@baychak

Description

@baychak

Bug in https://vega.github.io/vega/examples/table-scrollbar.vg.json for top position

Image

Suggested fix:
Change

    {
      "name": "scaleScrollBarY",
      "type": "linear",
      "domain": [1, {"signal": "scrollPositionMax"}],
      "range": [
        {"signal": "0"},
        {"signal": "rowHeight*rowsToDisplay-scrollBarHeight-1"}
      ]
    },

to:

    {
      "name": "scaleScrollBarY",
      "type": "linear",
      "domain": [0, {"signal": "scrollPositionMax - 1"}],
      "range": [
        {"signal": "1"},
        {"signal": "rowHeight*rowsToDisplay-scrollBarHeight-1"}
      ]
    },

and in line 165 change:
"y": {"scale": "scaleScrollBarY", "signal": "scrollPosition"},
to:
"y": {"scale": "scaleScrollBarY", "signal": "scrollPosition - 1"},

After fix:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions