Skip to content

Getter in child component resolves this to parent scope instead of its own component #467

@serhumanos

Description

@serhumanos

Describe the bug
When using a getter inside a nested Alpine component, the this context does not reliably refer to the component where the getter is defined. Instead, it may resolve properties from the parent component scope.

This leads to unexpected behavior where a child component getter returns values from the parent

Device information (please complete the following information):

  • OS:linux
  • Browser firefox
  • Extension version ??
  • Alpine.js version 3.11.0

Code sample

Minimal code sample (ideally inline, not codesanbox/codepen as those have been deleted before the issue could be addressed in the past)

[https://jsfiddle.net/pbgcvswq/](https://jsfiddle.net/pbgcvswq/)

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions