Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context value received in wrong order if bind:this is set on a slot #7606

Open
vatro opened this issue Jun 14, 2022 · 0 comments
Open

Context value received in wrong order if bind:this is set on a slot #7606

vatro opened this issue Jun 14, 2022 · 0 comments

Comments

@vatro
Copy link

vatro commented Jun 14, 2022

Describe the bug

Given this structure:

<Wrapper>
  <Comp>
    <Cont/>
    <Comp/>
  </Comp>
</Wrapper>

where:

  • <Wrapper> : shares a store via context
  • <Comp> : gets the store / a value from it + has a <slot/>
  • <Cont> : contains <Comp> with two slots populated

For simplicity, let's call the <Comp> inside <Cont>: Child-Comp

If bind:this is set on any of Child-Comp's slots: the Child-Comp will always get context / store value first, before anything else / it's higher parent components.

Reproduction

REPL getContext order (ok)
REPL getContext order (bad)

Logs

no error

REPL console log (order ok):

"wrapper--child-0 got store value"
"wrapper--child-0--slot-0 got store value"
"wrapper--child-0--slot-0--child-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-0--child-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-0--child-1 got store value"
"wrapper--child-0--slot-0--child-0--slot-1--child-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-1--child-1 got store value"
"wrapper--child-0--slot-1 got store value"

REPL console log (order bad):

"wrapper--child-0--slot-0--child-0 got store value"
"wrapper--child-0 got store value"
"wrapper--child-0--slot-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-0--child-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-0--child-1 got store value"
"wrapper--child-0--slot-0--child-0--slot-1--child-0 got store value"
"wrapper--child-0--slot-0--child-0--slot-1--child-1 got store value"
"wrapper--child-0--slot-1 got store value"

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz    
    Memory: 24.02 GB / 31.93 GB
  Binaries:
    Node: 17.9.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD 
    npm: 8.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 102.0.5005.115
    Edge: Spartan (44.19041.1266.0), Chromium (102.0.1245.39)
    Internet Explorer: 11.0.19041.1566

Severity

annoyance

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

No branches or pull requests

1 participant