Skip to content

scrollLeft returns decimal values in firefox #9223

@Janpot

Description

@Janpot

Describe the bug

Since 4.0.14, we see decimal values for scrollLeft in firefox

- Expected
+ Received

- 200
+ 200.35000610351562

 ❯ test/basic.test.ts:21:34
     19| 
     20|   container.scrollLeft = 200;
     21|   expect(container.scrollLeft).to.equal(200);
       |                                  ^
     22| });
     23| 

doesn't happen in other browsers, doesn't happen in 4.0.13.

Bifurcated with pkg.pr.new and it seems to originate in 64502a2 (or the parent commit, CI completely failed for that one)

Reproduction

See https://github.com/Janpot/vitest-repro-scroll

System Info

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1
    Memory: 60.77 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.7.0 - ~/.nvm/versions/node/v24.7.0/bin/node
    npm: 11.5.1 - ~/.nvm/versions/node/v24.7.0/bin/npm
    pnpm: 10.13.1 - ~/.nvm/versions/node/v24.7.0/bin/pnpm
  Browsers:
    Safari: 17.6
  npmPackages:
    @vitest/browser-playwright: latest => 4.0.15 
    @vitest/ui: latest => 4.0.15 
    playwright: 1.57.0 => 1.57.0 
    vite: latest => 7.2.7 
    vitest: latest => 4.0.15

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions