Skip to content

feat: add virtualization to S2 combobox and picker #8110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

yihuiliao
Copy link
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Apr 17, 2025

@rspbot
Copy link

rspbot commented Apr 17, 2025

@rspbot
Copy link

rspbot commented Apr 17, 2025

);
}

const Separator = /*#__PURE__*/ createLeafComponent('separator', function Separator(props: SeparatorProps & {size?: 'S' | 'M' | 'L' | 'XL'}, ref: ForwardedRef<HTMLElement>) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does feel a little overkill to import separator separately but it's at least a pretty simple component ...i can probably simplify the code since this isn't being used anywhere else except for picker + combobox. given that it's not interactive and just a visual thing, i don't think it has any accessibility requirements.

otherwise, i experimented a little bit with adding a bottom border which would work i think? i would need to play around with the linear-gradient so that the visible border aligns with the item text and it'd require some additional targeting of first-child/last-child but i think it should be possible. that said, not sure if it's worth the time figuring this out if this current solution works

':is(:last-child > &)': 'none',
default: 'flex'
},
// marginX: {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if anyone knows why edgeToText isn't working, let me know...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, i could do something like this which seems to work and wouldn't define the space using pixels:

  marginX: {
    size: {
      S: '[calc(var(--marginSpace) * 3 / 8)]',
      M: '[calc(var(--marginSpace) * 3 / 8)]',
      L: '[calc(var(--marginSpace) * 3 / 8)]',
      XL: '[calc(var(--marginSpace) * 3 / 8)]'
    }
  },
  '--marginSpace': {
    type: 'marginStart',
    value: {
      size: {
        S: 24,
        M: 32,
        L: 40,
        XL: 48
      }
    }

@rspbot
Copy link

rspbot commented Apr 18, 2025

);
}

export const ManyItems: Story = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i noticed that the picker's popover is pretty slow to open once it's clicked. not an issue when it's just opened by keyboard tho. i haven't looked into it too much but if anyone might have leads that would be appreciated

@adobe adobe deleted a comment from rspbot Apr 21, 2025
@yihuiliao yihuiliao changed the title wip: S2 combobox picker virtualizer feat: add virtualization to S2 combobox and picker Apr 22, 2025
@yihuiliao yihuiliao marked this pull request as ready for review April 22, 2025 00:37
@rspbot
Copy link

rspbot commented Apr 22, 2025

@adobe adobe deleted a comment from rspbot Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants