You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is a reactivity problem when I use slot forwarding through the couple of components and passing props back.
The forwarded slot I use twice. One within {#if} block and the second one in {#each} (so slot it some template markup for Grid Component with inline editor). The one within #each renders normally. But when slot inside the #if condition appears, the parent component doesn't show markup within its own #if block (the condition involving passed back props is true, but the :else block is rendered).
I couldn't reproduce this bug in REPL example. But I tried. I've noted there a wrong behavior (see comments and console.log).
Can't attach the real component here, sorry. But the principle there is almost the same.
Here's what's generated from the real component:
There is a call of select_block_type(ctx, [-1]) at the line 262.
If I understand correctly: [-1] means that everything is dirty (all bit are 1's).
So dirty is an array with one element here.
And at the line 257 we have such precondition for #if block: if (dirty[1] & 137494528)
And that's strange because there is no second element in dirty. So condition is always falsy.
Seems to be a bug.
Severity
Severe.
So thanks in advance for quick fix or some workaround hint.
Additional context
Note that slot in Comp2 in the repl example is used twice (just like in my real component). Maybe this somehow affects.
Also if I click at the div where :else content (inside < div slot="" > of parent component) is rendered, it immediately switches to #if block as it should be from the beginning. If this helps.
Generated code part
```
// (195:4)
function create_cellTemplate_slot(ctx) {
let div;
let t0;
let t1_value = (/*r*/ ctx[49] === -1
? console.log(/*mode*/ ctx[51], /*editorValues*/ ctx[52], /*row*/ ctx[47], /*col*/ ctx[48])
: "", "") + "";
let t1;
let t2;
let show_if;
let current_block_type_index;
let if_block;
let current;
const if_block_creators = [create_if_block, create_else_block];
const if_blocks = [];
function select_block_type(ctx, dirty) {
//HERE IS THE PROBLEM MAYBE
if (dirty[1] & /mode, editorValues, listItemData, col/ 137494528) show_if = !!([const__WEBPACK_IMPORTED_MODULE_5__.ENUM.MODE.LIST_EDITOR.CREATE, const__WEBPACK_IMPORTED_MODULE_5__.ENUM.MODE.LIST_EDITOR.MODIFY].includes(/mode/ ctx[51]) && /editorValues/ ctx[52][keyField] === /listItemData/ ctx[58][keyField] && !/col/ ctx[48].readonly);
if (show_if) return 0;
return 1;
}
//OR HERE
current_block_type_index = select_block_type(ctx, [-1]); //<--is [-1] correct? Because dirty[1] is undefined in this case.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing as possible duplicate of #4318 . A reproduction, perhaps in form of a GitHub repository, would be appreciated as there's still no reproduction for this.
Describe the bug
There is a reactivity problem when I use slot forwarding through the couple of components and passing props back.
The forwarded slot I use twice. One within {#if} block and the second one in {#each} (so slot it some template markup for Grid Component with inline editor). The one within #each renders normally. But when slot inside the #if condition appears, the parent component doesn't show markup within its own #if block (the condition involving passed back props is true, but the :else block is rendered).
I couldn't reproduce this bug in REPL example. But I tried. I've noted there a wrong behavior (see comments and console.log).
Can't attach the real component here, sorry. But the principle there is almost the same.
Here's what's generated from the real component:
There is a call of
select_block_type(ctx, [-1])
at the line 262.If I understand correctly: [-1] means that everything is dirty (all bit are 1's).
So dirty is an array with one element here.
And at the line 257 we have such precondition for #if block:
if (dirty[1] & 137494528)
And that's strange because there is no second element in dirty. So condition is always falsy.
Seems to be a bug.
Severity
Severe.
So thanks in advance for quick fix or some workaround hint.
Additional context
Note that slot in Comp2 in the repl example is used twice (just like in my real component). Maybe this somehow affects.
Also if I click at the div where :else content (inside < div slot="" > of parent component) is rendered, it immediately switches to #if block as it should be from the beginning. If this helps.
Generated code part
``` // (195:4)//HERE IS THE PROBLEM MAYBE
if (dirty[1] & /mode, editorValues, listItemData, col/ 137494528) show_if = !!([const__WEBPACK_IMPORTED_MODULE_5__.ENUM.MODE.LIST_EDITOR.CREATE, const__WEBPACK_IMPORTED_MODULE_5__.ENUM.MODE.LIST_EDITOR.MODIFY].includes(/mode/ ctx[51]) && /editorValues/ ctx[52][keyField] === /listItemData/ ctx[58][keyField] && !/col/ ctx[48].readonly);
if (show_if) return 0;
return 1;
}
//OR HERE
current_block_type_index = select_block_type(ctx, [-1]); //<--is [-1] correct? Because dirty[1] is undefined in this case.
The text was updated successfully, but these errors were encountered: