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

input-tree searchApi 搜索后选中丢失原先选中数据 Bug #9946

Closed
Ladtor opened this issue Apr 1, 2024 · 3 comments · Fixed by #9944
Closed

input-tree searchApi 搜索后选中丢失原先选中数据 Bug #9946

Ladtor opened this issue Apr 1, 2024 · 3 comments · Fixed by #9944
Assignees
Labels
awaiting-release bug Something isn't working

Comments

@Ladtor
Copy link

Ladtor commented Apr 1, 2024

描述问题:

请用一段清晰简洁的文字描述问题是什么...

截图或视频:

20240401153227_rec_

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

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

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.3.0

  3. 粘贴有问题的完整 amis schema 代码:

{
  "body": [
    {
      "autoCheckChildren": false,
      "extractValue": true,
      "joinValues": false,
      "multiple": true,
      "name": "tree",
      "searchApi": "/api/tree-options${term}.json",
      "searchable": true,
      "source": {
        "cache": 500,
        "url": "/api/tree-options1.json"
      },
      "type": "input-tree"
    }
  ],
  "debug": true,
  "type": "form"
}
// tree-options1.json
{
  "code": 0,
  "data": [
    {
      "children": [
        {
          "label": "A-1",
          "value": "a1"
        }
      ],
      "label": "A",
      "value": "a"
    },
    {
      "children": [
        {
          "label": "B-1",
          "value": "b1"
        },
        {
          "label": "B-2",
          "value": "b2"
        }
      ],
      "label": "B",
      "value": "b"
    }
  ],
  "message": "ok"
}
// tree-options2.json
{
  "code": 0,
  "data": [
    {
      "children": [
        {
          "label": "A-1",
          "value": "a1"
        }
      ],
      "label": "A",
      "value": "a"
    },
    {
      "children": [
        {
          "label": "B-2",
          "value": "b2"
        }
      ],
      "label": "B",
      "value": "b"
    }
  ],
  "message": "ok"
}
  1. 操作步骤
    选择后,搜索其他选项,再选中,之前选中的选项丢失
@Ladtor
Copy link
Author

Ladtor commented Apr 1, 2024

同样的,使用input-text 变量联动 input-tree.source 也存在相同的问题

@2betop
Copy link
Collaborator

2betop commented Apr 1, 2024

input-tree 修复了,input-text 是什么场景?

@Ladtor
Copy link
Author

Ladtor commented Apr 2, 2024

input-tree 修复了,input-text 是什么场景?
忽略,searchApi有bug时尝试自己拼接组件联动而已

@Ladtor Ladtor closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
@Ladtor Ladtor closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-release bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants