Skip to content

rendered dom lose scroll prop #13464

Activity

zhangenming

zhangenming commented on Jun 12, 2025

@zhangenming
ContributorAuthor

i use scroll as a tailwind css prop

LinusBorg

LinusBorg commented on Jun 12, 2025

@LinusBorg
Member

Vue allows you to set both HTML attributes and Element properties through the template. By default, it check is an element has a property of the same name, and if yes, it sets the value from the template as the element property, not as an HTML attribute. If there's no element property of that name, it sets it as an attribute

Now, scroll is a property/method on Elements:

https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll

So possible solutions:

A) use a different name that does not conflict with a known HTML element property
B) Force Vue to set it as an attribute:

<input scroll.attr />
locked and limited conversation to collaborators on Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      rendered dom lose `scroll` prop · Issue #13464 · vuejs/core