Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

[mdc-slider] unable to be pre-rendered on server #5058

@devversion

Description

@devversion

Bug report

The current implementation of the mdc-slider cannot be pre-rendered on the server because the foundation has the following problems:

  1. It uses DOM globals which cannot be proxied through the adapter.
    https://github.com/material-components/material-components-web/blob/master/packages/mdc-slider/foundation.ts#L499-L500

  2. It expects element dimensions to be computed on foundation init. This is problematic because on the server, the element dimensions cannot be measured. This prevents us from pre-rendering the initial value of the slider.

Actual behavior

MDC-slider cannot be pre-rendered.

Expected behavior

MDC-slider can be pre-rendered on the server.

Your Environment:

Software Version(s)
MDC Web v4.0.0-alpha.0
Browser Chrome
Operating System Windows

Additional context

We need this to be able to provide a slider implementation for Angular components based on the MDC slider foundation.

Possible solution

Ideally the mdc-slider foundation would have an adapter method for retrieving the style property names (see bullet point 1). And to solve the second bullet point, the slider would not depend on element measurements to move the thumb (i.e. just using percentage to move the thumb). Element measurements are only needed for determining the value from a pointer click.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions