[BUG] @alifd/meet field parseName 数组下标赋值丢失
- 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?
Fusion Mobile
### Minimal code and steps to reproduce the bug
```
const [state, setState] = useState({
list: [
{
id: 1,
name: "123"
}
]
});
const field = Field.useField({
values: {
list: [
{
id: 1,
name: "123"
}
]
},
parseName: true,
onChange: (name, value) => {
console.log(name, value);
console.log(111, field.getValues());
setState(field.getValues());
}
});
return (
{state?.list.map((item, itemIdx) => {
return (
);
})}
);
```
### Current and expected behavior
- 预期:正确修改数组对应下标的key的value
- 现实:name对应的字段都丢失了
### Environment
最新
### build.json
_No response_
### Possible solution
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by reproducing the minimal Fusion Mobile example using Field.useField with parseName enabled and an indexed list.name field. Inspect the values reported by onChange and field.getValues(); the bug is fixed when editing an array item preserves the value at its corresponding index and does not drop the name fields.
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