Skip to content

fix: Expose XList scrollHeight/scrollWidth getters#2156

Merged
Sherry-hue merged 4 commits intomainfrom
copilot/add-scrollheight-getter-xlist
Feb 2, 2026
Merged

fix: Expose XList scrollHeight/scrollWidth getters#2156
Sherry-hue merged 4 commits intomainfrom
copilot/add-scrollheight-getter-xlist

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 29, 2026

Add missing scroll metrics to x-list so consumers can read container dimensions directly, aligning with existing scrollTop/scrollLeft behavior.

  • XList API

    • Add scrollHeight and scrollWidth getters delegating to the internal scroll container.
  • Test coverage

    • Extend get-scroll-container-info to assert both getters match reported container metrics.
  • Release metadata

    • Add a patch changeset for @lynx-js/web-elements.

Example:

const list = document.querySelector('x-list') as any;
const { scrollHeight, scrollWidth } = list.getScrollContainerInfo();
console.log(list.scrollHeight === scrollHeight, list.scrollWidth === scrollWidth);

[!WARNING]

Original prompt

This section details on the original issue you should resolve

<filter_complete></filter_complete>

<issue_title>[Task] add scrollHeight getter for XList</issue_title>
<issue_description></issue_description>

<agent_instructions>1. See packages/web-platform/web-elements/src/elements/XList/XList.ts
2. like scrollTop, we should add a new getter for scrollHeight
3. add tests at packages/web-platform/web-elements/tests/web-elements.spec.ts</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Original prompt

This section details on the original issue you should resolve

<issue_title>[Task] add scrollHeight getter for XList</issue_title>
<issue_description></issue_description>

<agent_instructions>1. See packages/web-platform/web-elements/src/elements/XList/XList.ts
2. like scrollTop, we should add a new getter for scrollHeight
3. add tests at packages/web-platform/web-elements/tests/web-elements.spec.ts</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: 4f7181d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 2 commits January 29, 2026 12:24
Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add scrollHeight getter for XList Expose XList scrollHeight/scrollWidth getters Jan 29, 2026
Copilot AI requested a review from PupilTong January 29, 2026 12:32
@PupilTong PupilTong marked this pull request as ready for review January 29, 2026 14:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jan 29, 2026

CodSpeed Performance Report

Merging this PR will improve performance by 6.05%

Comparing copilot/add-scrollheight-getter-xlist (28c1862) with main (3cdf389)

Summary

⚡ 2 improved benchmarks
✅ 61 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 47.5 ms 45 ms +5.51%
basic-performance-div-10000 484.1 ms 456.5 ms +6.05%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@PupilTong
Copy link
Copy Markdown
Collaborator

@copilot add a patch changeset

Co-authored-by: PupilTong <12288479+PupilTong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 2, 2026

@copilot add a patch changeset

Added a changeset for @lynx-js/web-elements in commit 28c1862.

@PupilTong PupilTong changed the title Expose XList scrollHeight/scrollWidth getters fix: Expose XList scrollHeight/scrollWidth getters Feb 2, 2026
@PupilTong PupilTong requested a review from Sherry-hue February 2, 2026 07:52
@Sherry-hue Sherry-hue enabled auto-merge (squash) February 2, 2026 07:56
@Sherry-hue Sherry-hue merged commit e0972ef into main Feb 2, 2026
42 of 44 checks passed
@Sherry-hue Sherry-hue deleted the copilot/add-scrollheight-getter-xlist branch February 2, 2026 07:56
colinaaa pushed a commit that referenced this pull request Feb 23, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/motion@0.0.3

### Patch Changes

- Fix an issue that motion/mini will accidentally imports full version,
causing compiling error
([#2204](#2204))

## @lynx-js/react@0.116.3

### Patch Changes

- fix: remove `lynx.createSelectorQuery` deprecated warning in
production
([#2195](#2195))

- Add a DEV-only guard that detects MainThread flush loops caused by
re-entrant MTS handlers.
([#2159](#2159))

This typically happens when a MainThread handler (e.g. event callback or
`MainThreadRef`) performs UI mutations (like `Element.setStyleProperty`,
`setStyleProperties`, `setAttribute`, or `invoke`) that synchronously
trigger a flush which re-enters the handler again.

- Avoid DEV_ONLY_SetSnapshotEntryName on standalone lazy bundle.
([#2184](#2184))

- Add alog and trace for BTS event handlers.
([#2102](#2102))

- fix: Main thread functions cannot access properties on `this` before
hydration completes.
([#2194](#2194))

    This fixes the `cannot convert to object` error.

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

- fix: captured variables in main thread functions within class
components do not update correctly
([#2197](#2197))

## @lynx-js/rspeedy@0.13.4

### Patch Changes

- Bump ts-blank-space v0.7.0
([#2238](#2238))

- Bump Rsbuild v1.7.3 with Rspack v1.7.5.
([#2189](#2189))

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.8

## @lynx-js/qrcode-rsbuild-plugin@0.4.5

### Patch Changes

- Only register console shortcuts when running in TTY environments
([#2202](#2202))

## @lynx-js/react-rsbuild-plugin@0.12.8

### Patch Changes

- Updated dependencies
\[[`4240138`](4240138)]:
    -   @lynx-js/react-webpack-plugin@0.7.4
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.8
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4
    -   @lynx-js/template-webpack-plugin@0.10.3

## @lynx-js/testing-environment@0.1.11

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## @lynx-js/web-constants@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-core@0.19.8

### Patch Changes

- fix: avoid error when LynxView is removed immediately after connected
([#2182](#2182))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8
    -   @lynx-js/web-worker-runtime@0.19.8

## @lynx-js/web-core-wasm@0.0.3

### Patch Changes

- Updated dependencies
\[[`e0972ef`](e0972ef),
[`3bc017e`](3bc017e),
[`e2d349e`](e2d349e),
[`d924b6a`](d924b6a)]:
    -   @lynx-js/web-elements@0.11.2
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-elements@0.11.2

### Patch Changes

- Add scrollHeight/scrollWidth getters to XList.
([#2156](#2156))

- Inherit padding styles for x-input elements.
([#2199](#2199))

- Remove the default lazy-loading attribute from x-image elements.
([#2186](#2186))

- Fix x-input number type forwarding to the inner input element.
([#2193](#2193))

## @lynx-js/web-mainthread-apis@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8

## @lynx-js/web-worker-runtime@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/react-webpack-plugin@0.7.4

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## create-rspeedy@0.13.4



## @lynx-js/react-alias-rsbuild-plugin@0.12.8



## upgrade-rspeedy@0.13.4



## @lynx-js/web-core-server@0.19.8



## @lynx-js/web-rsbuild-server-middleware@0.19.8



## @lynx-js/web-worker-rpc@0.19.8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

[Task] add scrollHeight getter for XList

3 participants