Skip to content

[EuiDataGrid] Pass scroll position data as args in onScroll - #8688

Merged
mgadewoll merged 6 commits into
elastic:mainfrom
mgadewoll:datagrid/8422-enhance-onscroll-callback-args
May 9, 2025
Merged

mgadewoll merged 6 commits into
elastic:mainfrom
mgadewoll:datagrid/8422-enhance-onscroll-callback-args

Conversation

@mgadewoll

@mgadewoll mgadewoll commented May 7, 2025 •

Copy link
Copy Markdown
Contributor

Summary

closes #8422

This PR updates the virtualizationOptions.onScroll prop on EuiDataGrid by passing additional scroll position data as callback arguments. This allows consumers to handle additional checks based on scroll position, e.g. identify when a user has scrolled to the end of the grid.

QA

Screenshot 2025-05-07 at 09 15 52

  • (optional) checkout this PR and review the new functionality in Storybook:
    • open the "Virtualization" story and scroll
    • review the onScroll arguments output in the "Actions" tab and confirm the values update correctly

Screenshot 2025-05-06 at 14 41 33

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@mgadewoll mgadewoll self-assigned this May 7, 2025
@mgadewoll mgadewoll changed the title [EuiDataGrid] [EuiDataGrid] Pass scroll position data as args in onScroll May 7, 2025
@mgadewoll
mgadewoll marked this pull request as ready for review May 7, 2025 08:40
@mgadewoll
mgadewoll requested a review from a team as a code owner May 7, 2025 08:40
@acstll
acstll self-requested a review May 9, 2025 09:14

@acstll acstll left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only two non-blocking comments, so I'm approving already (feel free to skip them) — a pleasure to review as always 👍

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll
mgadewoll merged commit fe6f2e8 into elastic:main May 9, 2025
tkajtoch added a commit to elastic/kibana that referenced this pull request May 28, 2025
`102.1.0` ⏩ `102.2.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v102.2.0`](https://github.com/elastic/eui/releases/v102.2.0)

- Added `useIsDarkMode` utility
([#8701](elastic/eui#8701))
- Added scroll position data as arguments to
`virtualizationOptions.onScroll` for the virtualized `EuiDataGrid`
([#8688](elastic/eui#8688))
- Updated secondary fill to `primary` on `EuiIcon`
([#8687](elastic/eui#8687))
- Added white outline on EuiLoadingElastic to make it compliant with the
Brand requirements ([#8684](elastic/eui#8684))

**Bug fixes**

- Fixed `EuiGlobalToastList` toasts not being cleaned properly when they
are added and removed at the same time
([#8692](elastic/eui#8692))
- Resolved an issue where the `EuiDataGrid` cell actions menu was hidden
by the header when a cell was clicked to scroll into view
([#8640](elastic/eui#8640))

**Accessibility**

- Improved accessibility of `EuiSelect` by removing the empty `<option>`
added when `hasNoInitialSelection` is `true` from the DOM, once a user
makes a selection. ([#8706](elastic/eui#8706))
- Improved the accessibility of `EuiSuperDatePicker`'s quick select
buttons by preventing duplicate screen reader output
([#8686](elastic/eui#8686))

Co-authored-by: Elastic Machine <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 28, 2025
`102.1.0` ⏩ `102.2.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v102.2.0`](https://github.com/elastic/eui/releases/v102.2.0)

- Added `useIsDarkMode` utility
([elastic#8701](elastic/eui#8701))
- Added scroll position data as arguments to
`virtualizationOptions.onScroll` for the virtualized `EuiDataGrid`
([elastic#8688](elastic/eui#8688))
- Updated secondary fill to `primary` on `EuiIcon`
([elastic#8687](elastic/eui#8687))
- Added white outline on EuiLoadingElastic to make it compliant with the
Brand requirements ([elastic#8684](elastic/eui#8684))

**Bug fixes**

- Fixed `EuiGlobalToastList` toasts not being cleaned properly when they
are added and removed at the same time
([elastic#8692](elastic/eui#8692))
- Resolved an issue where the `EuiDataGrid` cell actions menu was hidden
by the header when a cell was clicked to scroll into view
([elastic#8640](elastic/eui#8640))

**Accessibility**

- Improved accessibility of `EuiSelect` by removing the empty `<option>`
added when `hasNoInitialSelection` is `true` from the DOM, once a user
makes a selection. ([elastic#8706](elastic/eui#8706))
- Improved the accessibility of `EuiSuperDatePicker`'s quick select
buttons by preventing duplicate screen reader output
([elastic#8686](elastic/eui#8686))

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit a5ff0f4)
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
`102.1.0` ⏩ `102.2.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v102.2.0`](https://github.com/elastic/eui/releases/v102.2.0)

- Added `useIsDarkMode` utility
([elastic#8701](elastic/eui#8701))
- Added scroll position data as arguments to
`virtualizationOptions.onScroll` for the virtualized `EuiDataGrid`
([elastic#8688](elastic/eui#8688))
- Updated secondary fill to `primary` on `EuiIcon`
([elastic#8687](elastic/eui#8687))
- Added white outline on EuiLoadingElastic to make it compliant with the
Brand requirements ([elastic#8684](elastic/eui#8684))

**Bug fixes**

- Fixed `EuiGlobalToastList` toasts not being cleaned properly when they
are added and removed at the same time
([elastic#8692](elastic/eui#8692))
- Resolved an issue where the `EuiDataGrid` cell actions menu was hidden
by the header when a cell was clicked to scroll into view
([elastic#8640](elastic/eui#8640))

**Accessibility**

- Improved accessibility of `EuiSelect` by removing the empty `<option>`
added when `hasNoInitialSelection` is `true` from the DOM, once a user
makes a selection. ([elastic#8706](elastic/eui#8706))
- Improved the accessibility of `EuiSuperDatePicker`'s quick select
buttons by preventing duplicate screen reader output
([elastic#8686](elastic/eui#8686))

Co-authored-by: Elastic Machine <[email protected]>
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
`102.1.0` ⏩ `102.2.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v102.2.0`](https://github.com/elastic/eui/releases/v102.2.0)

- Added `useIsDarkMode` utility
([elastic#8701](elastic/eui#8701))
- Added scroll position data as arguments to
`virtualizationOptions.onScroll` for the virtualized `EuiDataGrid`
([elastic#8688](elastic/eui#8688))
- Updated secondary fill to `primary` on `EuiIcon`
([elastic#8687](elastic/eui#8687))
- Added white outline on EuiLoadingElastic to make it compliant with the
Brand requirements ([elastic#8684](elastic/eui#8684))

**Bug fixes**

- Fixed `EuiGlobalToastList` toasts not being cleaned properly when they
are added and removed at the same time
([elastic#8692](elastic/eui#8692))
- Resolved an issue where the `EuiDataGrid` cell actions menu was hidden
by the header when a cell was clicked to scroll into view
([elastic#8640](elastic/eui#8640))

**Accessibility**

- Improved accessibility of `EuiSelect` by removing the empty `<option>`
added when `hasNoInitialSelection` is `true` from the DOM, once a user
makes a selection. ([elastic#8706](elastic/eui#8706))
- Improved the accessibility of `EuiSuperDatePicker`'s quick select
buttons by preventing duplicate screen reader output
([elastic#8686](elastic/eui#8686))

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiDataGrid] Identifying when the user has scrolled to the bottom.

3 participants