baidu / baidu/amis

inputTable宽度超过一屏时,编辑后面的字段后滚动条会自动复位,影响操作体验

Open
#7,640 0 comments 0 reactions 0 assignees View on GitHub
confirmed
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

1. needConfirm配置为true时会把所有字段挤到一个屏幕里 导致有的字段显示不完整
1. needConfirm配置为false时 滚动条滑动到后面编辑某个字段后这个滚动条会自动复位到前面 影响操作

#### 截图或视频:

https://github.com/baidu/amis/assets/54106885/54ca6f80-e4fa-4263-9157-92b8cc8895e9

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
`sdk`

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
v3.2.0
3. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "input-table",
"columnsTogglable":false,
"needConfirm": false,
"name": "specTable",
"id": "addItem-input-table",
"addBtnLabel": "",
"draggable": true,
"deleteBtnIcon": false,
"addBtnIcon": false,
"copyable": true,
"copyBtnLabel": "复制",
"copyBtnIcon": false,
"columns": [
{
"name": "skuId",
"width": 0,
"type": "hidden"
},
{
"name": "itemType",
"width": 0,
"type": "hidden"
},
{
"name": "ticketType",
"width": 230,
"type": "input-text",
"label": "票面类型"
},
{
"name": "price",
"type": "input-number",
"width": 150,
"min": 0,
"precision": 2,
"step": 0.01,
"label": "售卖价(元)"
},
{
"name": "storage",
"type": "input-number",
"min": 1,
"width": 150,
"label": "库存(张)"
},
{
"name": "ticketCapacity",
"type": "input-number",
"min": 1,
"width": 150,
"label": "包含人数"
},
{
"name": "checkableCount",
"label": "单张票可核销次数",
"disabled": true,
},
{
"type": "input-datetime",
"name": "salesStartTime",
"format": "YYYY-MM-DD HH:mm:ss",
"width": 320,
"label": "销售开始时间"
},
{
"type": "input-datetime",
"name": "salesEndTime",
"format": "YYYY-MM-DD HH:mm:ss",
"width": 320,
"label": "销售结束时间"
},
{
"name": "isEnabled",
"type": "select",
"label": "状态",
"width": 120,
"value": true,
options: [
{
"label": "正常",
"value": true
},
{
"label": "下线",
"value": false
}

]
},
{
"name": "remark",
"type": "input-text",
"width": 320,
"label": "备注"
}
]
},
],

},
```

4. 操作步骤

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the provided input-table schema, comparing needConfirm set to true and false. Trace the input-table entry point and observe what happens to the horizontal scroll position after editing a later field; done means fields remain usable and editing does not unexpectedly reset the scroll position.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.