alibaba / alibaba/rax

[BUG] x-if x-elseif 中间如果加注释会失效

Open
#2,383 1 comment 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
8k
Forks
611
PR merge metrics
No merged PRs in 30d

Description

### ⌨️

- [ ] Would you like to work on a fix?

### Where is the bug from?

Rax App

### Minimal code and steps to reproduce the bug

```jsx
const booleanList = [true, false, true];
1
{/* 下面会显示出来 */}
2
3
```

### Current and expected behavior

如果再x-if 和x-elseif中间插入注释 下面的内容会不按逻辑展示
![image](https://user-images.githubusercontent.com/31799911/190551159-fb4608ec-7d1c-4424-9f8c-89449bd1ecea.png)

### Environment

任意

### build.json

_No response_

### Possible solution

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the minimal JSX reproduction from the issue and trace how Rax processes adjacent x-if and x-elseif nodes when a comment appears between them. Done means the comment no longer changes which conditional content is rendered, while the supplied boolean cases still behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.