Skip to content

Picker - determine initial scroll position for variable height items #1935

@bmingles

Description

@bmingles
  • The Picker currently calculates the initial scroll position for the selected item by finding the index and multiplying by item height. This only works for items with consistent heights. Spectrum exposes the keys as data-key attributes, so we should be able to find the target position without knowing the item height.
  • Also, there is a subtle bug when using uncontrolled Pickers. Since the position is determined by selectedKey ?? defaultSelectedKey, the position will be incorrect if the user selects a new item and then re-opens. We'll need to maintain the selection internally.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions